• Resolved jacky_K

    (@jacky_k)


    Hello!
    I used a filter
    add_filter( 'wpseo_og_article_published_time', 'my_func_yoast_publish_date', 90, 2 );

    But after the last update, it stopped working.
    How can I change the publication date of article?

    • This topic was modified 4 years, 6 months ago by jacky_K.
    • This topic was modified 4 years, 6 months ago by jacky_K.
Viewing 16 replies (of 16 total)
  • Thank you @mihdan I’ve been looking for this. @finalwebsites Yoast explained; Some filters and actions were deprecated since v14.0 of Yoast SEO for WordPress. LINK

    I just removed Modified date and published date using the code provided by @mihdan

    add_filter(
    ‘wpseo_frontend_presenter_classes’,
    function ( $filter ) {

    if (($key = array_search(‘Yoast\WP\SEO\Presenters\Open_Graph\Article_Modified_Time_Presenter’, $filter)) !== false) {
    unset($filter[$key]);
    }

    return $filter;
    }
    );

    add_filter(
    ‘wpseo_frontend_presenter_classes’,
    function ( $filter ) {

    if (($key = array_search(‘Yoast\WP\SEO\Presenters\Open_Graph\Article_Published_Time_Presenter’, $filter)) !== false) {
    unset($filter[$key]);
    }

    return $filter;
    }
    );

    I can now change the presenters to remove any OG output I please ??

    • This reply was modified 4 years, 5 months ago by blissyung.
    • This reply was modified 4 years, 5 months ago by blissyung.
Viewing 16 replies (of 16 total)
  • The topic ‘Filter for Open Graph article:published_time’ is closed to new replies.