[Resolved] Delete modified/updated time/date from HTML

Home Forums Support Delete modified/updated time/date from HTML

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #89297
    Andrey

    Hi Tom!

    I wonder where exactly I can find the code that shows meta property=”article:modified_time” and meta property=”og:updated_time”. I would like to delete it so that this info does not show in search results.

    #89540
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Adding this function to your child theme functions.php or using the plugin “Code Snippets” should remove the updated and published time schema tags: https://gist.github.com/generatepress/9986c15bbffafa0cc7e1

    Let me know 🙂

    #89623
    Andrey

    Tom, thank you so much for the code! So far it doesn’t work. I’ll see tomorrow if it works on new posts.

    In the code description you mentioned “delete published time”. Is it really going to delete the published date? I need the original date of publication, the ones I don’t need are modified and updated.

    #89857
    Tom
    Lead Developer
    Lead Developer

    Weird – adding that code should overwrite the default function in the theme if you added it in your child theme’s functions.php.

    It basically removed the updated date/time, and removed the schema.org info from the date published.

    #89866
    Andrey

    I do not have a child’s theme. So I added the code throught the Code Snippets.

    When you say hat the code should remove the schema.org info from the date published, does it mean there will be no published date in the code at all?

    #90068
    Tom
    Lead Developer
    Lead Developer

    It will still display the published date, it just won’t have the tags that tell Google the published and modified date. Humans are still able to see it. Is that what you wanted, or did you want something different?

    #90082
    Andrey

    I need published date both for humans and robots:
    <meta property=”article:published_time” content=”2015-03-23T00:30:05+00:00″ />

    What I don’t need (and what is still displayed in the html) are the following two lines of code:
    <meta property=”article:modified_time” content=”2015-03-23T09:05:39+00:00″ />
    <meta property=”og:updated_time” content=”2015-03-23T09:05:39+00:00″ />

    #90322
    Tom
    Lead Developer
    Lead Developer

    Ah, well GeneratePress doesn’t add those tags.

    Those may be added by your SEO plugin, or another plugin you have installed.

    Deactivate each plugin one by one until it disappears. Then you’ll need to ask that plugin developer how to remove them.

    #90863
    Andrey

    Tom, sorry, that was my mistake to think it is solely the theme’s issue. I will try to ask in Yoast SEO support if it’s their fault. But so far I don’t see any option in Yoast SEO plugin to edit what kind of metadata exactly is on and how to disable some. Thanks again for looking into my problem!

    #90914
    Tom
    Lead Developer
    Lead Developer

    No worries!

    One way to check without having to wait for support is to disable plugins one by one until the tags disappear.

    That will at least tell you which plugin is adding them 🙂

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