If you wish to embed a SharePoint Library in WordPress, you have to options. You can create a WordPress shortcode using the generator and add it to a page or add a Documents block to a page.
If you wish to embed a SharePoint Library in WordPress using a typical WP shortcode then please continue with Option A | Create a WP shortcode instead.
Perform the following steps to add a Documents block to a page to embed a SharePoint Library in WordPress.
- Create a new post or page or start editing an existing one.
- Type /docs or select the Documents block with help of the WordPress Block Picker.
- As soon as you focus on the Documents block, its Configuration panel will open the side. As long as the page is in edit mode, the Documents block – if it has focus – will display show an application that can be used to test the configuration.
Options included in the basic edition
The basic free version of the embedded SharePoint Library is included in the WPO365 | LOGIN plugin that can be downloaded for free from the WordPress Plugins Directory and the WPO365.com website.
- Select SharePoint Library from the Datasource radio buttons group.
To learn about the other available datasource that you can connect to, check the following links:
- OneDrive
- Recent Documents
- Type the hostname of your SharePoint Online home. For example, in our case we enter wpo365demo.sharepoint.com because our SharePoint Online home is https://wpo365demo.sharepoint.com.
- Enter the managed path of the site collection where the library that you wish to embed resides, for example sites/contoso.
- Enter the title of the library that you wish to embed. Please note that the title of the library can be found in SharePoint just above the list with documents, for example Documents and not
Shared%20Documents.aspx. - Optionally, you can choose to Hide message bar. The message bar is mainly used by the free version of the embedded library, to inform that this version does not support folder navigation.
Options included in the premium edition
Premium options are unlocked by the WPO365 | M365 APPS addon or the WPO365 | INTRANET bundle.
Please note When you upgrade to benefit of any of the premium options, you must add a new block Documents | Premium and replace the Documents | Basic blocks that you created with the free version included in the WPO365 | LOGIN plugin.
- Folder navigation (= breadcrumb navigation) will be enabled by default and does not require further configuration.
- Optionally, you can specify a Folder (relative path or empty for root) that is below the root folder of the library. If entered, only items in that folder (and any folders nested in that folder) will be available to users. For example entering General/HR Guidelines will instruct WPO365 to only show items in that folder and in folders nested in that folder.
- Optionally, you can enable users that do not have an enterprise account in your Microsoft Entra ID / Azure AD to view items in the embedded SharePoint Library by checking the option to Allow anonymous users. Please note, however, that this requires additional configuration. See Advanced | Access for “anonymous” users.
- Optionally, you can Use query string for configuration. If checked, you can “inject” the configuration of the app’s hostname, server relative path, library title and folder by means of a dynamically assembled query string. Refer to the example below to understand how to build the query string.
https://your-wordpress-website/page-with-embedded-app/?serverRelativePath=sites%2Fcontoso&listTitle=Documents&libraryRelativeFolderPath=General%2FCollateral
- Optionally, you can click to Edit Columns that the block will display and can connect each of those columns with a (custom) SharePoint list item field. Please check Advanced | Customize your columns for details.
- Optionally, you can click to Edit Translations to support your own language instead.
- Optionally, you can check the option to Show “Open in SharePoint” link. If checked, a link that will open the embedded library in SharePoint Online will be displayed.
Test your configuration
After you completed your configuration, it’s time to test it by simply clicking Start test.