Friday, March 24, 2023

Stop Wordpress from removing Microdata from pages and posts

Do you experience Microdata disappears from your pages and posts?

What makes Wordpress remove Microdata data?

It happens within Classic Editor or in Block Editor in sections managed by Classic Editor. I experienced that after saving my content.

It happens because the editor knows which attributes are used in standard HTML pages and it encounters new and unknown attributes. The editor decides that they are not needed and removes them.


Partial solution

One part of the solution is written in this page.


Complete solution

So here are instructions to solve the whole problem:

  1. Install this plugin - Advanced TinyMCE Configuration Plugin
  2. Dont worry that the plugin is old. It works flowlessly with Wordpress 6.2.x. I guess it would work after years because there is almost no changes in Classical editor. 
  3. Enter this option name: extended_valid_elements
  4. The option value you want to add: @[itemscope|itemtype|itemid|itemprop|content],div,span,h1,h2,h2,h4,h5,h6time[datetime]

Result

You will keep your Schema Microdata inside your content. Movies, recipes, movies, real estate software products, flights, images, video... everything All your content would be rated better in search engines because Google puts this content in top position. Boost your content with Rich snippets.

Check your results

You could use the official validator from schema or to check your pages.

No comments:

Post a Comment