How to fix missing updated class issue in WordPress

In your WordPress updated articles were added to the label is a good choice,So you can be notified to search engines when your article is the updated。Other,Today, search engines and the latest number of the recently updated content ratings as one of the items,Then add your WordPress articles which updated the label becomes necessary。

Structured Data Errors

When using Google Webmaster Tools site page analysis,You will find three crawl errors,Each of these three seems to be a system using a WordPress blog sites will encounter,One of them is about the updated class of,Be called:

missing updated class

The cause of the error is caused by the lack of in your article page update information,We can know the updated data segment is required by Google's manual,Published but it is not necessary! Other,updated entry-title and the two fields requires two class,But if you both write,Then congratulations,Search engines will ignore the content of ╮ out updated(╯▽╰)╭

So,The best way is to keep only Updated。

Make your blog page display the date the label is updated

This approach based on the theme you are using ever-changing,Especially if you use a third-party themes and not standardized,Oh more people。So,Here it,Twenty routing theme comes with WordPress Fourteen example,Of course,This is because the current (or at least the time of this writing) off the grid is using Twenty Fourteen。

For any topic yet,Routing is recommended that you use the "sub-theme" approach to theme changes,This avoids a great extent on the theme update when overwrite your changes,For example, statistical code,For example, now we have to do to modify。

otherwise,Two months later, who knows what you changed。Usage (on sub-theme is actually very simple,The official Chinese version will now have,Tells in great detail,Specific links could see footer "Further Reading"。)

The theme for the Twenty Fourteen,It defines this regard is in fact inc / template-tags.php file

Specific code excerpt me down:

of course,We can not go directly to modify the file - although it can achieve immediate effect,But once the update,I am afraid not so good about the。

So,Characteristics we use to overwrite the sub-theme of this function。It has a function of covering documents,functions.php is one of them,Specific reference is recommended that you go to official documents,Only here the route description,This file is in the definition of sub-themes are a few more special,It is not just a direct replacement for the parent theme files,But it may be additional functions and replace function on the parent topic。

Changes about three parts:

  1. Updated display - Edit the functions.php get_the_date Function with get_the_modified_date Substitute。 In this way you will publish date below the article title change last updated。
  2. Updated Class - Add to updated class to tag page,So that error on wood it。
  3. Show Updated Text - Displays the latest updates words in front of your date,Province to the release date and the time difference between the latest review date three or four years -

Below is the modified functions:

This article is not original,Code and content are referenced,See the original page "Further Reading"。

Further reading

WordPress subtopics

How to Add Updated Date to WordPress Articles

Original article written by Gerber drop-off:R0uter's Blog » How to fix missing updated class issue in WordPress

Reproduced Please keep the source and description link:https://www.logcg.com/archives/827.html

About the Author

R0uter

The non-declaration,I have written articles are original,Reproduced, please indicate the link on this page and my name。

Comments

    1. I ask you to use this approach must be the subject of 2014,Else you need to make changes to modify ~ I used to use allinone SEO,Yost now use the SEO feeling good,Because of the subject matter I've commented out code,But google is still not being given again。You can also try。

Leave a Reply

Your email address will not be published. Required fields are marked *