Skip to content
Advertisement

How can I get wordpress page content without html tags? [closed]

$content = get_the_content(); 
var_dump($content);
<figure class="wp-block-gallery columns-1 is-cropped"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><img src="http://www.frizon.rs/wp-content/uploads/2020/11/veliki-frizider.jpg" alt="" data-id="67" data-full-url="http://www.frizon.rs/wp-content/uploads/2020/11/veliki-frizider.jpg" data-link="http://www.frizon.rs/veliki-frizider/" class="wp-image-67"/></figure></li></ul></figure>

This is what I get from my page and i can’t make some changes.

Advertisement

Answer

Use wp_strip_all_tags function wp_strip_all_tags

wp_strip_all_tags( $content );

Thanks!

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement