Problem:
PDF and Office document previews are no longer working when using a OneDrive Business account in the plugin.
Cause
This behavior occurs when your Microsoft Business account is connected with read + write access (Entire Drive).
Due to a security vulnerability in the Microsoft Graph /preview endpoint, preview functionality is currently disabled by the plugin for Business accounts using this scope. This is a limitation outside of the plugin and depends on Microsoft’s implementation of the preview API.
Accounts connected with read-only access are not affected and can still use the preview functionality.
Solution
Option 1: Use read-only access (recommended)
If you do not need upload or file management features (such as rename, delete, or share), you can restore previews by reconnecting your account with read-only access:
- Reconnect your Microsoft account using the “Entire Drive (read-only)” scope
- Follow the steps in this FAQ: How do I change my Microsoft account connection to “read-only”?
This is the safest and recommended solution.
Option 2: Restore previews with full access (advanced)
If you require write access (for example uploads or file management) and are working in a controlled environment (such as an intranet with additional security like 2FA), you may choose to re-enable previews.
You can do this by adding the following filter:
add_filter('shareonedrive_require_vulnerability_fix', '__return_false');Add this code to your theme’s functions.php file or use a plugin like “Code Snippets”.
After applying the change:
- Go to the plugin settings → Tools tab
- Click Purge Cache
Important: This workaround disables the protection against the known vulnerability. Only use this if you understand the risks.
Important note
Preview functionality for OneDrive Business accounts with full read + write access will remain disabled by default until Microsoft resolves the issue in their API.