Last month, I had to make a bulk update of SEO properties from Pages in one of our customers website that runs SharePoint 2016. Basically we needed to update every property that was empty based on an Excel spreadsheet. This file defined the Keywords and Meta Descriptions for each area of the site. In this post I’m going cover how to update SEO Properties in SharePoint programmatically!

SEO properties that SharePoint supports

SharePoint supports some SEO properties to be edited out-of-box:
– Title: the page’s title;
– Browser Title: the title that will be presented in your Web Browser;
– Meta description: the description the Search Engines will read and present on their results;
– Meta keywords: the keywords that will help the Search engines on classifying your content;
– Hide from Search Engines: radio button option. It lets you say if the page will be hidden or not from search engines.

SEO Properties inside SharePoint form

The code that updates SEO Properties

You can find below how the code will look like! So you can update all your pages inside an specific Site Collection like our example presents wiliammbr.sharepoint.onpremises.com.

Finally with that code I hope you can update SEO properties more easily. So your customers will benefit from better content ranked on Google, Bing and other Search Engines, after you update SEO Properties in SharePoint programmatically.

Also, if you want to learn more about how to use and configure Canonical Tags in SharePoint, please check my post about Canonical Tags in SharePoint. In that post I try to explain how they work and how can you change it.

Furthermore, you can check this book that may help you on learning all the best practices in 2019 for Search Engine Optimization:

References:
Microsoft Docs.