Introduction

I’ve been collecting notes and half-writing tutorials in OneNote for long time. I’ve recently started blogging and found the workflow of taking content from OneNote, finalising and tidying in Word before publishing to WordPress really cumbersome.

If you’re wondering why I’d want to do it that way, good point! It’s simply because I have tonnes of content already c70% complete that I don’t want to lose.

Repurposing by copying and pasting text from OneNote to WordPress isn’t too bad but I’ve found once there’s images, tables and more than basic formatting involved, it’s proving a nightmare.

So a quick Google later, I found there’s a WordPresss plugin called OneNote publisher. This allows us to create a new post or page in WordPress and instead of retype or copy and paste our OneNote content, all we need to do is browse to the notebook we which to use, select a page and it all magically makes its way into the Title and Editor… images, tables and all 🙂

The only catch / obstacle is that authentication is a bit of a pain and requires some setup in Azue – hence me writing this handy article…

Stage 1 – Install the OneNote Publisher plugin in WordPress

Go to Plugins > Add New

Appearance Plugins Users Tools Create new page View your site Customising the Manage and ad Installed Plugins Add New Plugin Editor

Search for OneNote Publisher

Click Activate

Comments Feedback Assistant Appeara plugins Editor users Tools Sett.ngs Collapse Add Plugins Featured popular = Plugin Name 'Our WordPreSS posts or OneNote ard content all existing note-S. publisher Active updated; ago untested "ith version Of

Once activated, go to Settings

o nstalled Plugins Add New Plugin Editor OneNote Publisher for WordPress Deactivate The OneN0te Publisher for WordPress plugin allows you to publish your OneN0te pages into posts or pages. Version 1.1 | By Microsoft I View details

Note – the instruction link provided is out of date. Application registrations have now moved to Azure

Media Cornrnents Feedback OneN0te Publisher for WordPress Options MSA OAuth settings MSA MSA Client S.eoet

You’ll need to provide authentication details. Let’s see how to set those up in Azure…

Stage 2 – Register the plugin as an app in Azure to allow login and sharing of OneNote information

Login to https://portal.azure.com and go to Application registrations (as of the timing of writing, the URL is https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade)

Click New Registration

Microsoft Azure Home App registrations points Dom-Oed Preview features Got feedbRk?

Enter a name for the registration e.g. My WordPress blog

Select an option under Supported account types

In the Redirect URL field, enter your WordPress admin URL e.g. https://myblog.com/wp-admin

Click Register

Register an application * Name The user-facing display name for this application (this can be changed later), My WordPress Blog Supported account types Who can use this application or access this API? O Accounts in this organizational directory only (Musso IT Limited only - Single tenant) O Accounts in any organizational directory (Any Azure AD directory - Multitenant) @ Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox) Personal Microsoft accounts only Help me choose... Redirect URI (optional) We'll return the authentication response to this URI after successfully authenticating the user. Providing this now is optional and it can be changed later, but a value is required for most authentication scenarios. x Web v https://myblog.com/wp-admin By proceeding. you agree to the Microsoft Platform Policies Reaister

You should then be taken back to the Application registrations page.

The app is now registered. Finally, we’ll need to set up a secret key for the configuration in WordPress…

Click to open your app

App registrations + New registration Endpoints Troubleshooting Download preview features ry out the new App registrations search preview! Click to enable the preview. x Got feedback? Starting June 30th, 2020 We Will no longer add any features to Azure Active Directory Authentication Library (ADAL) and Azure AD Graph. We Will continue to provide technical support and security updates but We Will no longer provide feature updates. Applications will need to be upgraded to Microsoft Authentication Library (MSAL) and Microsoft Graph. Learn more All applications Owned applications p Start typing a name or Application ID to filter these results Display name customerflowportalb2c ranco Musso WordPress Blog Application (client) ID Created on 9/29/2020 2/2/2021 Certificates & secrets

Select Certificates & secrets from the left hand nav

Franco Musso WordPress Blog Search (Ctrl* n Overview Quickstart Integration assistant Manage Branding Authentication Certificates & secrets Token configuration API permissions Delete Endpoints Preview features O Got a second? We would love your feedback on Microsoft identity platform (previously Azure AD for developer). * A Essentials Display name Application (client) ID Directory (tenant) ID Object ID . Franco Musso WordPress Blog Supported account types Redirect URIS Application ID URI Managed application in l. O Starting June 30th, 2020 we will no longer add any new features to Azure Active Directory Authentication Library (ADAL) and Azure security updates but we will no longer provide feature updates, Applications will need to be upgraded to Microsoft Authentication

Click + New client secret

Enter a Description, choose an expiry date and click Add

My WordPress Blog Certificates & secrets Add a client secret 80, -

We’re now ready to populate the plugin settings in WordPress and give this a go 😊

Copy the value from the client secret you just created

Owners Roles and administrators Preview Manifest Support Troubleshooting Troubleshooting New support request Client secrets A secret string that the application uses to prove its identity when requesting a token. Also can be referred to as application password. New client secret Description OneNote WordPress Plugin Expires 2/2/2022 Value Copy to clipboard

Paste that into the MSA Client Secret field back in WordPress

Posts Media Pages Comments Feedback Assistant Appearance Plugins OneNote Publisher for WordPress Options MSA OAuth settings MSA ClientlD: MSA Client Secret: Click here for instructions to setuzvour ClientlD & Secret) Save Options

Finally, we need the Client ID from our application registration

Head back to Azure

Select Overview from the left hand nav

Hover over the Application (client) ID field and click the copy icon

My WordPress Blog Search (Ctrl* n Overview Quickstart Integration assistant Manage Branding Authentication Delete Endpoints Preview features O Got a second? We would love your feedback on Microsoft identity platform (previously Azure AD for developer). * A Essentials Display name Application (client) ID Directory (tenant) ID Object ID My wordPress Blog Copy to clipboard Supported account types Redirect URIS Application ID URI Managed application in l.

Paste that into the xxx field back in WordPress

Click Save Options

OneNote publisher for WordPress Options

Let’s see what that actually does…

Go to Posts > Add New (feel free to use Pages rather than posts if you prefer)

usher for WordPress Options

You should now have a OneNote button in the editor…

Note – I prefer to use the classic editor. I’m not sure where this would appear in the Gutenberg editor

Clicking the OneNote button for the first time prompts us to login to our Microsoft account

Posts All Posts Add New Categories Tags Media Pages Comments Feedback Add a New Post Add title Paragraph Visual Publish Save Draft Status: Draft Text @ Visibility: public Preview Publish immediately Publish

Select a notebook and after a short delay (depending o the number and size of images), the editor will be populated with the title and contents of your OneNote notebook 😊

Posts All Posts Add New Categories Tags Media Pages Comments Feedback Assistant Appearance Plugins Users Tools Settings Collapse menu Add a New Post Add title Add Media Paragraph Word count: O Fxcprn t Add contact For i Franco Musso - PNLD Dev (CSR) - Microsoft Edge https:// francomusso.com/wp-admin/?code— -M.R3 BAY.f9659c1a-84a9-e802-... v All Notebooks Francesco's Notebook Power Apps Portals WordPress Plugins Setting up the OneNote Publisher plugin in WordPress OK Publish Save Draft Status: Draft @ Visibility: Public Publish immediately Categories Publish All Categories Most used C) Power Apps • Canvas Apps Power Apps - Model Driven Apps CD Power Apps Portals CD Power Automate C) Power gl C) Uncategorized Add New Categgry_

Et voila!

I’m no expert on anything Azure so for more details on application registrations, checkout the Microsoft Docs page here: https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app

It’s still early days for me using the plugin but seems to faithfully bring across headings, tables, images, text formatting, etc and seems much less hassle than my previous workflow of collate notes and write rough draft in OneNote, export to Word, copy to Blog Post template in Word and then publish to WordPress and tidy up before publishing!