SEO – Structured data and AMP pages with tagdiv amp plugin

Posted in: Newspaper
Post count: 16

Hi,

I noticed that the article structured data for “Article” on the amp page shows twice when tested with the structured data testing tool from google.
This happens because it reads one from the html structured and the second from the JSON LD script that holds the same thing on the amp page

So, on the normal page of a post only one article structured data shows On the amp page, shows 2 of the same

How can i fix this ? Is there a place i can modify the html for the amp template?

This happens with the tagdiv amp plugin. I tested with other amp plugins and they do not have this issue. I guess the solution would be to strip the html structured data from the amp html and work only with json ld. Any help please? Perhaps point me into the direction of the file i need to modify for the amp template and i will try to do it myself , see if i manage

Thank you

Post count: 16

Also, i would like to point that i think the article structured data is not complete
I checked other similar themes and for them when testing the structured data with google’s tools it shows a “show preview” button , kind of saying that their structured data is working
https://prnt.sc/misonf
when you click on that button it shows how that article will be displayed in search results. Check here: https://prnt.sc/misp3w

However with your theme when testing the data, it shows two articles structured datas ( like i said one from the html schema.org microdata and the other from the json-ld data ) and none of them show that button

Can you please guide me on how i can take care of this please?

Thank you

Post count: 20688

Hi,

I checked on my end, for me only one article meta is appearing in AMP posts
http://prntscr.com/mjh27i
The one from the plugin code – http://prntscr.com/mjh2kq

Regarding the preview button from what I can find online it seems to not appear at all times
https://productforums.google.com/forum/#!msg/webmasters/kvwA_yePpbo/PQvpE4biCAAJ
https://www.tassos.gr/joomla-extensions/google-structured-data-markup/docs/preview-button-not-showing-on-structured-data-testing-tool
So for example testing a post with recipe markup does show the button
http://prntscr.com/mjh5mq

Thanks

Post count: 16

Hi simion,
Well, this is interesting. Considering this happens on your blog too 🙂
Take a look at this
I tested your post https://tagdiv.com/infinite-loading-for-single-posts/amp/
Use the google structured data testing tool to test this url: https://search.google.com/structured-data/testing-tool?hl=ro

You will notice that the tool will see 2 Article elements on the page. Click on the article and it will display both. You can expand them both and you will be able to click on the values and it will take you on the source code to where that value is coming from
You will notice that one article element comes from the JSON code, which is great ( it is actually the recommended method ) and the second one comes from structured data html
Example
<span class=td-page-meta itemprop=author itemscope itemtype="https://schema.org/Person"><meta itemprop=name content="Alexandra I."></span><meta itemprop=datePublished content="2019-02-07T15:10:00+00:00"><meta itemprop=dateModified content="2019-02-07T15:36:38+00:00">
Things like this.

Screenshots:
https://prnt.sc/mjja2v
https://prnt.sc/mjjada

May I also mention that one of the article data ( the html one not the JSONLD one ) has some values that do not appear right. For example it ads an @id that creates an url that has /post-idnr at the end. In your case it created an url that has /amp/post-5951 at the end. That url is invalid i do not know why it was created like this
I cannot say more about this aspect with the extra values as I have not seen it happen on other similar websites
Maybe someone has more info on it, at least in regards to the 2xarticle data

Post count: 20688

Hi,

Seems that is the case, two “article” are detected with the tool just as you say. I will make a note of it and pass it along to the developer team. Thank you for taking the time to provide this detailed explanation.

The other issue you mention with the post-ID is already on our list. I should note that the AMP plugin is to receive modifications in coming updates, can’t provide specific information about it unfortunately. Chances are both these issues will be resolved. Please let us know if you have more questions or have something to add.

Thanks

Post count: 35

Hello,

My question is in regards to other Structured Data besides “Article”. What if I want to assign some posts as “News Article”, or “Video”, or “Review”. Where in the settings can I make those adjustments so that NOT everything is seen as “Article”?

Post count: 20688

@videomaker The article schema will always be loaded, it is defined in the theme code
https://www.screencast.com/t/LYDmez0RycL
You can add extra structured data with plugins for example, but the theme data will also be loaded (unless maybe you remove it from the theme code).

Post count: 35

So I am looking at the files and found these two:

1. themes/newspaper/includes/wp_booster/td_module_single_base.php
line #537 with function get_item_scope() THIS IS FROM WHAT YOU SHARED WITH ME.

2. themes/newspaper/includes/wp_booster/td_module.php
line #77 with function get_item_scope() has a comment above:
@deprecated – google changed the structured data requirements and we no longer use them on modules

So would my changes on #1 (themes/newspaper/includes/wp_booster/td_module_single_base.php) would still apply?

Post count: 20688

They will still work, depending on what modifications you want to do there. If you plan to modify the single file, you can do so in a child theme. This way you won’t lose them.

Post count: 35

Sounds good, I made the changes I want. How do I test to make sure my changes are indeed working?

Post count: 20688

Depends on what you did, if you modified/removed/added structured data, you can test with this tool – https://search.google.com/structured-data/testing-tool/u/0/

Post count: 12

Got Two article schema on amp pages. Have removed yoast structured data already. How to remove one article schema.

Post count: 20688

Hi,


@Sanjay
Kumar Monu So you removed the structured data loaded by Yoast. Then only the theme structured data should be present. The one from the theme can’t be disabled with settings, only by removing the data from the files.
If you would like to remove the article meta, that would be here
http://prntscr.com/olclws

Thanks

Post count: 15

@simion which part exactly. Could you please highlight the entire code?

Post count: 35449

Hi,

In order to remove ( remove all ) the structure data from amp you need to comment those lines of code -> http://prntscr.com/ovf34n after that make sure that you clear all cache and check the results.

Thank you!

Viewing 15 posts - 1 through 15 (of 15 total)
The forum ‘Newspaper’ is closed to new topics and replies.