• Resolved cantoute

    (@cantoute)


    I believe that this subject has appeared many times, but I could not put my hands on anything useful, perhaps you could help us out?

    Would be nice to see 1mg of doc 😉
    https://developer.yoast.com/features/seo-tags/titles/api => coming soon…

    Wordpress allows using html tags like <b> or <sup> in post title.

    Plugins such as wp-Typography could alter the title and add html tags on the fly too.

    Example:
    This my 1<sub>st</sub> post.

    Is there a way we can filter out any html tags from any social share meta data title?

    So far I’ve tried this without any success:

    
    add_filter( 'wpseo_title', 'filter_title_strip_all_tags', 0 );
    add_filter( 'wpseo_opengraph_title', 'filter_title_strip_all_tags', 0 );
    add_filter( 'wpseo_twitter_title', 'filter_title_strip_all_tags', 0 );
    function filter_title_strip_all_tags($title) {
    	return wp_strip_all_tags( $title );
    }

    `

    • This topic was modified 1 year, 8 months ago by cantoute.

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter cantoute

    (@cantoute)

    hi, any update?

    Thread Starter cantoute

    (@cantoute)

    After deeper investigation, those filters did work, it was an other plugin that was adding the wrong lines in the head and overtaking yoast.

    Sorry for the noise.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘stripping html tags in title in social sharing.’ is closed to new replies.