Google Search Console reported a bunch of structured data errors in a new WordPress blog I began recently. This was a surprise, because I didn't know I was offering structured data. The WordPress theme I've been using, Twenty Twelve, includes CSS styles in blog posts to support the hAtom microformat, which helps search engines recognize the components of a blog post such as the title, author and tags.

When Google crawled the blog, the Structured Data section of Search Console flagged 20 pages with the error "missing: updated," which indicated the data should have an element called updated that isn't there.

Screen shot of Structured Data report in Google Search Console

I did some digging and found that WordPress bloggers are solving this problem in some complicated ways, like adding a plugin just to filter the structured data out. But I found an easier solution.

The updated style indicates when a blog post was last updated. In every page that displays a blog entry, updated should be in the HTML where the post time is displayed. Here's an example prior to the fix:

<time class="entry-date" datetime="2016-04-02T19:39:49+00:00">April 2, 2016</time></a>

Any blog post can include hAtom structured data by adding class names to the tags that surround an element. The updated class should be added to the time tag, turning the HTML into this:

<time class="entry-date updated" datetime="2016-04-02T19:39:49+00:00">April 2, 2016</time></a>

In the folder for my blog's theme, I found the file I needed to edit to add this fix: functions.php. This file is a collection of PHP functions to enhance the theme and modify WordPress functionality.

In a function called twentytwelve_entry_meta(), I found the line where the blog post's time is displayed. I edited the line to add the reference to updated. Here's the line after the change:

$date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date updated" datetime="%3$s">%4$s</time></a>', esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() )
);

I'm still learning about WordPress and not ready to make major changes to a theme's PHP code, but this fix is a minor adjustment to the HTML output, so I thought it would be safe to attempt. The fix was successful: When I test my blog's pages in Google's Structured Data Testing Tool they pass.

The fix I've described works in the Twenty Twelve theme -- and probably some of the other basic themes for WordPress. Because each theme has different HTML, you may find the code that displays the time someplace else.

-- Rogers Cadenhead

Comments

TO GET LOAN @ 2% INTEREST RATE with victoriafinancier@outlook.com

IF you are looking for a loan amount of little or huge amount between $10, 000USD to $100,000.00USD @ 2% interest rate, you will have to contact Victoria Financier Trust Company ( victoriafinancier@outlook.com ). She help me with funds urgently when i was desperate in need of money to payoff my debt after my husband medical expense and more funds assistance to pay our mortgage and refinance my business. I read about Victoria Lawson on how she have help lots of person and she attend to me urgently when i contacted and explain my situation to her. She has help lots of persons that i refer to her too. Contact her now with VIA EMAIL: victoriafinancier@outlook.com

*Full Name:_________

*Address:_________

*Tell:_________

*loan amount:_________

*Loan duration:_________

*Country:_________

*Purpose of loan:_________

*Monthly Income:__________

*Occupation__________

*Next of kin:_________

*Email :_________


 

Tomato soup is really very delicious and tasty dishes which I like much. I was buy management assignment online searching some recipes from online tools but your recipes is really mouth watering and I appreciate you for post this great info. This website is the best source to get valuable writing knowledge from our native writers.


 

Are you in financial need?we offer all kind. we offer the best at a low interest rate, search no further, Contact us now :email:

EMAIL: chongieloans@aol.co.uk
WEB SITE: www.chongieloans.webs.com

Best Regards
Chongie B.l.A
Chongie Financing Plc.


 

Oscar Entrepreneur Venture is one of the leading independent private company services and manage a wide variety of security and legitimate loans such as students loans, real estate loans, business loans, personal loans, debt consolidation loans etc on behalf of lenders and investors at an affordable annual interest rate of 3%.
Please return below short form if you are interested in getting a loan from us:

Full Name:
Address:
Amount Needed:
Duration:
Phone:
Country:

Return Short Form to:oscarentrepreneur@gmail.com


 

Add a Comment

These HTML tags are permitted: p, b, i, a, and blockquote. A comment may not include more than three links. Participants in this discussion should note the site's moderation policy.

:
:
: