[Support request] How to remove ‘hatom’ structured data

Home Forums Support How to remove ‘hatom’ structured data

  • This topic has 5 replies, 3 voices, and was last updated 3 months ago by David.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1338085
    James

    Dear Support,
    How do I remove ‘Hatom’ structured data? I’m not sure why this is generated, it seems to be really basic data that interferes with more complex structured data plugins.

    One problem is how it displays:

    updated 23 June 2020, 00:27
    published 23 June 2020, 00:05

    Whereas my structured data plugin generates it in a much more comprehensive way (ie. with timezone and seconds).

    datePublished 2020-06-23T00:05:36+01:00
    dateModified 2020-06-23T00:27:25+01:00

    I believe this is causing SEO issues such as the ‘time preview’ not coming up in Google. ie. When it says posted ‘8 minutes ago’.

    I’ve narrowed this down to the theme, it still appears when all plugins are disabled with only the theme activated.

    Please direct me on how I can disable this with custom development. I really cannot wait on this incase it is affecting the search results.

    Thanks

    #1338743
    David
    Staff
    Customer Support

    Hi there,

    by default GP outputs its time stamps like so:

    <time class="updated" datetime="2020-06-23T13:01:31+00:00" itemprop="dateModified">June 23, 2020</time>
    <time class="entry-date published" datetime="2020-06-04T15:43:32+00:00" itemprop="datePublished">June 4, 2020</time>

    You can however filter its output to whatever you need using the generate_post_date_output filter

    https://docs.generatepress.com/article/generate_post_date_output/

    #1339208
    James

    Hi David,
    Thanks for your reply.

    Where is ‘hatom’ being generated from in the structured data for each post?

    It’s showing the date / time as:

    updated 23 June 2020, 00:27
    published 23 June 2020, 00:05

    I would like to either edit this or turn it off completely.

    #1339511
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    As of right now, the hatom stuff is generated using classes throughout the theme, which can’t be removed without editing those files.

    I’m working on a way to disable it just like you can with the schema microdata in 2.5.0.

    For the time being, it shouldn’t be interfering with anything – it’s simply a collection of HTML classes. When it comes to your date not showing in search engine results, it’s usually because Google needs there to be only one date in the markup. You can do that with this filter: https://docs.generatepress.com/article/generate_post_date_output/#only-show-updated-date

    #1340087
    James

    Hi Tom,
    Thanks for the reply.

    How long will it be until 2.5.0 is released?

    Is there anything I can do with the files now to manually remove the date / time from hatom? Even if I had to do this after each update until 2.5.0 I would be willing to.

    Thanks
    Stephen

    #1340158
    David
    Staff
    Customer Support

    As above you would use the filter here to make changes to the date time entry:

    https://docs.generatepress.com/article/generate_post_date_output/

    The example Tom provided from the same article:

    https://docs.generatepress.com/article/generate_post_date_output/#only-show-updated-date

    You simply need to edit the $time_string markup to remove the hAtom classes

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.