remove date from google search

Remove date from google search in WordPress

by Expert of Tech

In this paragraph, We will learn how to remove date from google search in WordPress. It’s useful for the older posts because visitors can’t guess it’s an old or new post. so let’s get started. When you use the Yoast SEO plugin then there are some solutions. Most importantly, The code I wrote it’s working for free and paid for both Yoast SEO plugins.

There is a lot of solutions but most of them are older. Here I got an updated solution. It’s working with Yoast SEO-free and premium version.


/* Remove date and time from google search */
add_filter(
    'wpseo_frontend_presenter_classes'
    , function($filter) {
        return array_diff($filter, [
            'Yoast\WP\SEO\Presenters\Open_Graph\Article_Published_Time_Presenter',
            'Yoast\WP\SEO\Presenters\Open_Graph\Article_Modified_Time_Presenter',
        ]);
    }
);

So, if you face any difficulties so feel free to contact one of our experts or visit the official site of Yoast SEO. To learn more best WordPress themes click here.

Share it