• Resolved tahtu

    (@tahtu)


    I would like to hide dates inside Google for some categories, but not in all.

    Is there a way doing this?

    The wpseo_opengraph_show_publish_date filter will be executed only if NOT is_singular(‘post’). So I think, I can’t use it.

    But I don’t understand the whole function publish_date(). apply_filters will be called with 3 parameters, but if I’m right its allowed to use two parameters only.

    Can you replace

    if ( ! is_singular( ‘post’ ) ) {
    if ( false === apply_filters( ‘wpseo_opengraph_show_publish_date’, false, get_post_type() ) ) {
    return false;
    }
    }

    with

    if ( false === apply_filters( ‘wpseo_opengraph_show_publish_date’, is_singular( ‘post’ ) ) ) {
    return false;
    }

    So the wpseo_opengraph_show_publish_date filter will be applied for every post, but the date will be shown for singular posts only.

    But maybe I’m totally wrong, since I didn’t find out, where publish_date() is called…

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    The filter wpseo_opengraph_show_publish_date you’re referring is only for outputting the page publish date when sharing on social media. It’s not specific for Google.

    Unfortunately, there is no option in our plugin to prevent dates from showing up in the search results. Ultimately, Google decides whether or not a date is shown in the search engine result pages. There are a few ways to influence this, but this is beyond the scope of our support on Yoast SEO. What we can do is refer you to a source here to learn more about this.

    Thread Starter tahtu

    (@tahtu)

    Ok, you are not interested to implement what I asked about.

    Nevertheless thanks a lot for your great software!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide dates for posts in some categories’ is closed to new replies.