SharePoint PDF file WopiFrame links open root folder

When a WopiFrame URL for a PDF file in SharePoint Online opens the containing folder instead of the PDF, it’s often because SharePoint’s Office Online service doesn’t directly handle PDF files in that way. Instead, it relies on the browser to open the PDF, which can lead to this redirection.

If you’ve ever clicked a SharePoint PDF link that uses the WopiFrame format — only to be redirected to the root folder instead of the actual file — you’re not alone. This frustrating behavior can disrupt workflows, confuse users, and make document access unnecessarily difficult.

Some references:

https://answers.microsoft.com/en-us/msoffice/forum/all/pdf-wopiframe-url-is-resolved-as-a-root-folder/f2931386-6af8-4bcf-b4f0-4d052655beb2

I am facing similar issues with the wopiframe url opening the root – Microsoft Community

When SharePoint PDF file WopiFrame links open root folder, it can be very difficult for users to know which actual file it was supposed to reference.

Understanding the Problem

SharePoint Online’s Office Online service, which typically handles opening and editing of documents, does not natively support opening PDF files directly.

The issue typically arises when WopiFrame links, which are meant to open documents directly in the browser, attempts to pass the document to the web browser to open. Instead of launching the PDF, the link defaults to the root of the document library. While this issue does not affect native Microsoft documents such as Word, Excel, PowerPoint and OneNote, this can be a great nuisance for users as there can be thousands of linked pdf files which are now basically inaccessible.

Solutions and Workarounds

  1. Use a Standard PDF URL:
    • Use the direct URL to the PDF file, such as https://domain.sharepoint.com/sites/abc/libraryname/xxx.pdf, which will allow the browser to handle the file. 
    • You can also use the “Open in Browser” option (often found in the document library’s ribbon) to open the PDF directly in your browser.
  2. Consider a PDF Reader Extension:
    • If you have a PDF reader extension installed in your browser, it may be able to open the PDF directly when you click the WopiFrame URL, bypassing the redirection. 
  3. Use a Different Browser:
    • Some browsers may handle the redirection differently. You can try opening the WopiFrame URL in a different browser like Firefox or Edge to see if it opens the PDF correctly. 
  4. Embedding with SharePoint’s File Viewer:
    • If you need to embed the PDF within a SharePoint page, consider using SharePoint’s “File Viewer” web part. This web part can be configured to embed the PDF directly on the page. 
  5. Using OneDrive Integration:
    • If you have OneDrive enabled, you can integrate your SharePoint files with OneDrive, which may offer a smoother experience for opening PDFs directly in the browser. 

SharePoint Essentials Toolkit to the rescue!

If the above does not work, don’t worry! Fortunately, there’s a reliable fix: the SharePoint Essentials Toolkit.

This powerful utility allows you to search for documents using either the document GUID or the relative path—two identifiers that remain consistent even when file names or locations change. Once you locate the correct PDF, you can replace the faulty WopiFrame link with a direct physical link to the file. This ensures that users are taken straight to the intended document, bypassing the WopiFrame altogether.

This fixes the issue where SharePoint PDF file WopiFrame links open in the root folder.

Here’s how to do it:

  1. Launch SharePoint Essentials Toolkit and connect to your site.
  2. Run an Item Inventory report to locate all PDFs and provide their document GUIDs and relative path.
  3. Export this to an Excel file, then import the file into a Find & Replace Link job.
  4. Choose the option to “Replace Completely”, this will replace the WopiFrame link that has the GUID in the URL, such as ‘https://XYZ.sharepoint.com/_layouts/15/WopiFrame.aspx?sourcedoc=GUID&action=default’
  5. Run the job, that’s it!
  6. This will replace the WopiFrame link in your content or navigation with the direct physical link to the document. You could also use a durable link instead, such as a Document ID link.

By using this method, you restore seamless access to your PDFs and eliminate the root folder redirect issue. It’s a simple yet effective solution that saves time and improves user experience across your SharePoint environment.

Do you use SharePoint? Try our toolkit
Download SharePoint Essentials Toolkit Now
Download the SharePoint Essentials Toolkit
Chris Ang

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.