Archived topic
Delete modified/updated time/date from HTML
9 replies · Started by Anonymous on March 21, 2015
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.
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 :)
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.
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.
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?
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?
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" />
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.
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!
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 :)