Community Forums › Forums › Archived Forums › Design Tips and Tricks › How Do I prevent the date of my blog post from showing up in search results?
Tagged: post_date
- This topic has 12 replies, 4 voices, and was last updated 4 years, 1 month ago by Maz.
-
AuthorPosts
-
March 4, 2020 at 12:41 pm #497131MazParticipant
Hello,
I am looking for a way to prevent the date of my blog posts from showing in search results. I don't want to use a plugin so is there an edit I can make in my child theme that will prevent the date from showing in search results?I am using the News Theme for my site.
Thank You!
March 4, 2020 at 7:02 pm #497139AnitaKeymasterYou will need a plugin to successfully do that.
Love coffee, chocolate and my Bella!
March 7, 2020 at 9:01 pm #497209Brad DaltonParticipantIn which search results? Are you referring to the search results page on your site or external search engines?
Try this code https://my.studiopress.com/documentation/snippets/entry-header-html5/customize-the-entry-header/
March 8, 2020 at 6:35 pm #497220MazParticipantThank you for responding. I don't want the date to show in Google search results. I was using the Simple Hooks Plugin for this, but I would rather not use a plugin to 'unhook' show post data in Google Search results.
March 9, 2020 at 9:57 pm #497231ShariLeeMemberIt is very easy to do this.
Just go to your dashboard;
Scroll down on the left hand side to SETTINGS/GENERAL;
Then scroll down to the date format;
Click on CUSTOM;
Erase anything in the little box;
Then scroll down to the SAVE CHANGES and click on it."Dates are Gone!" 😉
ShariLee Beynon
GoldaVere IMSMarch 10, 2020 at 6:48 am #497241MazParticipantThanks, ShariLee. I already have it set up this way in WordPress.
Yesterday I added the code below in my functions.php.//* Remove the post info function
remove_action( 'genesis_before_post_content', 'genesis_post_info' );I'm hoping this will remove the date from my blog posts in Google Search.
I'll have to wait and see.
March 10, 2020 at 6:18 pm #497253AnitaKeymasterYou really need an SEO plugin for this type of coding. Anything else will remove the date from the posts on the front end, which I assume you want to keep.
Love coffee, chocolate and my Bella!
March 10, 2020 at 10:10 pm #497255Brad DaltonParticipantNo need for a plugin, just hide it using CSS or remove it completely using PHP however, it's not a good idea to show the date to your site visitors and then something different to search engines which isn't the same your site visitors access.
March 11, 2020 at 9:01 am #497268MazParticipantYes. My blog is over 8 years old and I believe that showing the date in search engines may hurt click through rates. I blog about personal development so most of my content is evergreen. But having the date show in google search I believe is hurting my CTR.
I already have the date hidden on my blog posts on my site using CSS.
.post-info {
display:none;}
March 11, 2020 at 3:57 pm #497278AnitaKeymaster@maz using CSS to hide the date doesn't hide it from the source - view-source:https://www.mazzastick.com/nlp-hero-free-download/. It's only hiding it on the front end for your visitors.
Love coffee, chocolate and my Bella!
March 12, 2020 at 6:30 am #497292MazParticipantThanks Anita.
"Anything else will remove the date from the posts on the front end, which I assume you want to keep."
I added the CSS code on my blog to remove the date on my blog posts for visitors to my site.
I have checked some of my links in Google search and many of them have the date excluded and some still have the date added. So I am hoping the code I added to functions.php worked.
I checked the source code too. It looks like The Yoast SEO plugin is automatically adding the date published.
Adding the following code below to my functions.php should remove it from Studiopress.
//* Remove the post info function
remove_action( 'genesis_before_post_content', 'genesis_post_info' );I'll have to wait and see once Google updates my search results hopefully without the date showing.
As I mentioned before. Using the Simple Hooks plugin allowed me to remove the date from showing in search results. However, I didn't want to add another plugin just to perform that function when I am sure there is a code change I can make that would perform the same function.
March 12, 2020 at 4:01 pm #497301AnitaKeymasterOkay so let's go back to the beginning. You said you wanted to remove the date without a plugin. If you have Yoast installed, there is a setting in Yoast to remove the date. I don't understand what the issue is then? Remove it inside Yoast, remove the code from functions and you should be fine. Why won't you just use the setting in Yoast? There's probably a conflict since Yoast is active and Google sees it's active.
Love coffee, chocolate and my Bella!
March 12, 2020 at 5:31 pm #497303MazParticipantThe Yoast SEO date setting applies to the snippet preview you see on your post in the Yoast SEO meta box. This does not impact whether or not Google shows a date but, instead, allows you to adjust the snippet preview to match how Google handles your site.
https://yoast.com/help/date-appears-search-results/
Adding the below code to the theme functions.php will remove the date from search results for any Studiopress users who want to be able to do this without using a plugin.
Add the below code to the very bottom of (functions.php)
//* Remove the post info function
remove_action( 'genesis_before_post_content', 'genesis_post_info' );I went to Google Search Console and had them refresh a blog post link on my site. After waiting approximately 10 minutes I went back and searched the resubmitted link and now the date is gone in Google Search.
I hope this helps any StudioPress users who are looking for a way to manually remove the date from appearing in Google Search.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.