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
Search for OneNote Publisher
Click Activate
Once activated, go to Settings
Note – the instruction link provided is out of date. Application registrations have now moved to Azure
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
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
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
Select Certificates & secrets from the left hand nav
Click + New client secret
Enter a Description, choose an expiry date and click Add
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
Paste that into the MSA Client Secret field back in WordPress
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
Paste that into the xxx field back in WordPress
Click Save Options
Let’s see what that actually does…
Go to Posts > Add New (feel free to use Pages rather than posts if you prefer)
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
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 😊
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!