• Resolved krisgunnars

    (@krisgunnars)


    Hello,

    I have pages built with custom post types that are evergreen and should not have a date stamp.

    However, Google is pulling the dates for those pages from either the sitemap date column or the published_time or modified_time meta tags.

    How can I disable all dates for a custom post type?

    Thanks,
    Kris

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hi Kris!

    My apologies for the belated reply!

    Yes, Google can take the timestamp from either the sitemap or pull it from any tag on the page. I’m speculating they can also take a timestamp from the feed, but I have yet to confirm this.

    You can try your luck with this filter, which disables the timestamps outputted by TSF on nonhierarchical post types–it’s untested, so you might need to fiddle a bit with the is_singular() argument.

    add_filter( 'the_seo_framework_modifiedtime_output', 'my_disable_tsf_render_on_stocks', 999 );
    add_filter( 'the_seo_framework_publishedtime_output', 'my_disable_tsf_render_on_stocks', 999 );
    function my_disable_tsf_render_on_stocks( $output ) {
    
    	if ( is_singular( 'stocks' ) ) {
    		return '';
    	}
    
    	return $output;
    }

    Cheers 🙂

    Thread Starter krisgunnars

    (@krisgunnars)

    Thanks a lot! This worked to get rid of the timestamps from the header of the pages.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Remove published/modified date on custom post type’ is closed to new replies.