• Resolved Tweakfreaks

    (@tweakfreaks)


    I’m using the free version of Yoast SEO v27.7 and trying to use the wpseo_opengraph_desc filter and it’s not working.

    function clean_up_meta_description( $description) {
        if ( empty( $description ) ) {
            return $description;
        }
    
        $description = wp_strip_all_tags( $description );
    
        if ( preg_match( '/^.{1,300}[.!?]/', $description, $matches ) ) {
            $description = $matches[0];
        }
    
        return $description;
    }
    add_filter( 'wpseo_metadesc', 'clean_up_meta_description');
    add_filter( 'wpseo_opengraph_desc', 'clean_up_meta_description');

    The meta description is changed, but og:description is left untouched.

    What am I doing wrong?

Viewing 1 replies (of 1 total)
  • Thread Starter Tweakfreaks

    (@tweakfreaks)

    Resolved, the problem was between the keyboard and chair (had to remove the empty description check).

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.