How to remove in-line style of WordPress’s post content only?


My previous blog author using his font-family and size on every sentence of blog post. I want apply new css rule to post but it cant overide these in-line styles.

I tried searching around and found this one:

add_filter( 'the_content', function( $content ){
  return str_replace( ' style="', ' data-style="', $content);

But it removing style of whole website. I just want remove style that used on single post’s content only.

, , Hien Ho 3 years 2020-05-29T23:10:21-05:00 0 Answers 98 views 0

Leave an answer