If you’ve ever published the wrong file or page in SharePoint, you may need to quickly unpublish it. In SharePoint, the unpublish process works differently for site pages and documents, and in 2025, the modern interface doesn’t always show the option. That’s why I created this guide to clearly explain this recently asked query, i.e. how do I unpublish a document in SharePoint in seconds.
Here we’ll cover:
What’s Changed in 2025?
- Pages and documents behave differently. Modern site pages still have an Unpublish button. For documents in libraries, the option may not appear in the modern UI.
- Classic mode and APIs still work. If you can’t see “Unpublish” in the modern interface, you can still switch to the classic experience or use REST/CSOM/PowerShell to do it.
- Versioning rules apply. You can only unpublish the most recently published version of a document. Earlier published versions can’t be unpublished directly.
I got this information from the official Microsoft support. So, all are correct, because of them, the procedure of unpublishing is different in both sites and pages.
Don’t worry, all the steps and information I’ll provide you in the sections:
A) How Do I Unpublish a Document in SharePoint from a Site Page
If you need to unpublish a news post or a page:
- Select the Site contents > Pages or the Site Pages library.
- Choose the page, then click … (More) > Unpublish.
- Confirm the action. This reverts the page to Draft.
Remember, unpublishing a page doesn’t always remove it from search results immediately. To remove it from the search results, open the page Properties > Shared With > Stop sharing.
Related article: Microsoft SharePoint wants to use your confidential information
B) How I Unpublish a Document in a Library
Unpublishing a document works differently. Here’s the process I follow:
- Confirm prerequisites
- Versioning must be enabled with major and minor versions.
- At least one major version (like 1.0, 2.0) must exist.
- You need Contribute or Full Control permissions.
- Try the modern UI
- Go to the library > select the file > … (More) > Unpublish or Advanced > Unpublish this version.
- If the option appears, confirm, and the file will revert to a draft.
- If Unpublish is missing
- Switch to Classic Experience in the library, then select the file and choose Unpublish.
- Or use automation to answer how do I unpublish a document in SharePoint, which always works:
REST API:
POST /_api/web/getfilebyserverrelativeurl('/sites/xyz/library/my.docx')/unpublish(comment='Reverting to draft')
CSOM (PowerShell or C#):
$file.UnPublish("Reverting to draft")
PnPjs (JavaScript):
sp.web.getFileByServerRelativePath("/sites/xyz/library/my.docx").unpublish("reason");
What Happens When I Unpublish
- The latest major version has been withdrawn, and the document goes back to Draft.
- If earlier major versions exist, read-only users may still see that earlier version.
- Who can see drafts depends on Draft Item Security in the library settings. By default, only editors and approvers can see them.
Troubleshooting I’ve Seen
When learning how do I unpublish a document in SharePoint, you might see these issues:
- No “Unpublish” button issue in modern libraries is common. Switching to Classic or using REST/CSOM quickly resolves it.
- Readers still see something after you unpublish. To fix, adjust Draft Item Security so only editors can view drafts.
- Many users faced, too many versions piling up. I recommend setting version limits in Library Settings.
Author’s Verdict
Site pages are simple to unpublish with the built-in button, while documents depend on your tenant settings. Both of them require different instructions to follow, which we already covered in this discussion. I guarantee, now you clearly understand, i.e. how do I unpublish a document in SharePoint in seconds.
People Also Ask
- Do I need content approval to unpublish?
No, only major/minor versioning with a published major version. - Can I unpublish an older major version, like 3.0, directly?
No. Only the latest published version can be unpublished. To revert, restore the older version first. - Is there a supported way for admins to unpublish programmatically?
Yes, REST, CSOM, and PnPjs all support unpublish operations. - Why don’t readers see my draft after I unpublish it?
Because Draft Item Security is likely set to “Only users who can edit.” That setting is found under Library > Versioning Settings.