stripping html tags in title in social sharing.
-
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 ); }
`
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘stripping html tags in title in social sharing.’ is closed to new replies.