Sub topic 10
Publishing to the web is not the same as sharing
This chapter assumes you can already share a sheet with named people and you know the difference between Restricted and Anyone with the link general access. It covers a separate feature, Publish to the web, and explains why it is easy to confuse with sharing and why that confusion can expose data.
Two different systems
Sharing and publishing answer different questions.
- Sharing controls who may open the spreadsheet itself, using Google's access model: the owner, named people, and the general access setting. Everyone who opens a shared sheet does so through Google Sheets, with the role you gave them.
- Publishing to the web creates a separate public copy of the content at a different URL. That copy is a rendered view, or a data file, that anyone on the internet can fetch without a Google account.
Publishing does not change the Share dialog. A sheet can be set to Restricted and still have a live published version. The reverse also holds: a sheet set to Anyone with the link as Viewer may have never been published.
| Question | Sharing | Publish to the web |
|---|---|---|
| Where do you configure it? | Share button | File > Share > Publish to the web |
| What does the audience get? | Access to the spreadsheet with a role | A read-only rendering or file at a published URL |
| Is sign-in possible? | Yes, Restricted requires it | No, the published URL is public |
| Can you set Commenter or Editor? | Yes | No, output is read-only |
| Does Restricted block it? | Yes | No, it is independent |
| Typical use | Collaboration | Embedding in a web page, feeding other tools |
What publishing produces
In the Publish to the web dialog you choose what to publish and in what form.
- Scope. You can publish the Entire document (all sheets) or a single sheet.
- Format. The Link tab produces a web page. Formats for a single sheet include a web page, CSV, TSV, and PDF. The Embed tab produces an iframe snippet for placing the sheet in another web page.
- Published content and settings. You can choose to republish automatically when changes are made. This option is on by default.
After you select Publish and confirm the prompt, Google shows a URL. Anyone who has that URL can open it. The URL is not a secret you can rely on, because a link in an email, a web page, or a document can be copied and forwarded. Treat a published URL as public.
The published URL differs from the editing URL. A published page uses a path such as /spreadsheets/d/e/LONG_TOKEN/pubhtml, while an editing link ends in /edit. The d/e/ token is a separate publishing identifier, not your file ID. Knowing a published URL does not give anyone access to the editing view, and knowing the file ID from an editing link does not give anyone access to the published copy.
Editing link: https://docs.google.com/spreadsheets/d/FILE_ID/edit
Published page: https://docs.google.com/spreadsheets/d/e/PUBLISH_TOKEN/pubhtml
Published CSV: https://docs.google.com/spreadsheets/d/e/PUBLISH_TOKEN/pub?output=csvAutomatic republishing
With automatic republishing on, edits you make in the spreadsheet appear in the published version after a short delay. This is convenient for a public dashboard or a feed. It is also the way mistakes leak. If you type a private note into a published sheet, or paste in a column of email addresses, the change goes public without any further action from you.
If you turn the option off, the published version stays frozen at the moment you published it, until you republish.
Google's own help notes that the published page can take some time to update, so do not expect an instant reflection of edits. Treat the delay as unspecified.
Data you did not mean to publish
Publishing exposes the cells of the sheets you chose. Several things are easy to forget.
- Hidden rows, columns and sheets. Hiding is a display setting in the editor, not a security control. Do not assume hidden cells are excluded from the published output. If a sheet contains sensitive data, check the published output rather than relying on hiding. The safer practice is to move sensitive data to a different spreadsheet.
- Whole-document scope. Choosing Entire document publishes every sheet, including ones you add later. A scratch tab with personal data would appear in the published output.
- Formulas that pull in private data. Formulas such as
IMPORTRANGEcan copy data from a private spreadsheet into one you publish. The published page shows the values the formula returns, so the private data becomes public. - Protected ranges. Protection controls who can edit in the spreadsheet. It does not hide values from a published view, because the published view is a read-only rendering that does not use editor permissions.
- Comments and notes. Check your published output for these as well, instead of assuming they are excluded.
A worked example
Suppose you keep a price list in a sheet and want to show it on a company web page, while still keeping the sheet restricted to your team.
- Put the public data in its own tab, for example
PublicPrices, containing only the columns you intend to show. Keep costs and margins in a different spreadsheet. - Open File > Share > Publish to the web.
- In the first drop-down, select the
PublicPricessheet instead of Entire document. - Choose Embed and copy the snippet into your web page.
- Leave the Share dialog on Restricted. Colleagues who need access still get it as named people.
- Open the published URL in a private browser window. This confirms what an anonymous visitor sees.
The last step matters. A private browser window has no Google session, so it shows the real public output instead of what your signed-in account can see.
Checking and stopping publication
The Publish to the web dialog shows the state of publication. When a sheet is published, the dialog shows a Stop publishing button.
- Open File > Share > Publish to the web.
- Read the published scope. If it is published, the dialog says so and lists the published content.
- Select Stop publishing.
Stopping takes the published copy offline. The old URL no longer shows the data. Copies that other people already saved or embedded in cached pages are outside your control, and search engines may keep cached copies for some time.
Stopping publication does not change who can open the spreadsheet through sharing. Revoking a person's access in the Share dialog likewise does not stop the published page. You need to do both when you want to close all routes.
| Goal | Action needed |
|---|---|
| Remove one person's access to the spreadsheet | Remove them in the Share dialog |
| Close the public link to the spreadsheet | Set general access to Restricted |
| Take the published page offline | Stop publishing |
| Close everything | All three actions above |
Organization controls
In Google Workspace, an administrator can limit publishing as well as sharing. A setting can disable publishing outside the organization, or require users to confirm it. If the Publish to the web option is missing or blocked in your account, an organization policy is the likely cause. Ask your administrator, because you cannot override it from the sheet.
Choosing between them
Use these rules to choose.
- If you want people to collaborate, comment, or see the live spreadsheet, share it with named people and a role.
- If you want one specific person to see a live sheet, share it. Do not publish it.
- If you want an anonymous audience to see data on a web page, publish the smallest sheet that holds only public data.
- If you want people to get their own editable copy of a template, use a copy link as covered in the earlier chapter on sharing a copy, not publication.
- If you only need a one-off public read-only snapshot, publishing as PDF or sharing an Anyone with the link Viewer link may be simpler. Choose publication only when you need an embed or a stable data feed.
Common errors
- Assuming Restricted means private. It describes sharing only. Publication runs separately.
- Publishing the entire document by default. Pick one sheet.
- Trusting hidden cells. Move sensitive data out of the spreadsheet instead of hiding it.
- Forgetting about automatic republishing. A later edit goes public. Turn the option off for sheets that are edited often with mixed content.
- Revoking sharing and assuming it is finished. The published URL keeps working until you stop publishing.
- Testing while signed in. Your own account can see more than the public can, so use a private window.
Exercise
A teammate says, "I set the sheet to Restricted and removed the intern from the Share dialog, so the pricing data can no longer be seen outside the team." You earlier published the sheet to the web, and automatic republishing is on. Is the teammate right? Name the steps needed to close all routes.
Show answer
No. Restricted general access and removing the intern only control access to the spreadsheet through sharing. The published URL works separately and needs no sign-in, so anyone who has it can still read the data, and new edits keep appearing there because of automatic republishing. To close all routes, remove the intern in the Share dialog, set general access to Restricted, and open File > Share > Publish to the web and select Stop publishing. Then open the old published URL in a private browser window to confirm that it no longer shows the data.
Exercise
You want to show a public price list on a web page while the full spreadsheet, which also contains cost data, stays private. Describe the setup, and say how you would check that the result is correct.
Show answer
Put only the public columns in their own sheet, or better, in a separate spreadsheet so that cost data is not in the same file. Publish only that sheet, not the Entire document, and use the Embed option for the web page. Keep general access Restricted and share the full spreadsheet only with named people. To check, open the published URL in a private browser window and confirm that it shows only the price list.