Wordpress Restful Api without html tags

4.3k views Asked by At

I have the JSON API plugin installed on my WordPress installation, when I output my RESTFUL API, there are <p> tags and other html in there for example, in my app it will:

A line will say <p>Hello World</p> not Hello world (without html tags)

Does anyone know why and how this can be fixed? Thanks

1

There are 1 answers

0
Marc On BEST ANSWER

You can try removing the filter wpautop from the content on your site. -- This is assuming that "Hello World" is a part of the content, and that you don't mind removing the <p> tags from everywhere that the content is served.

remove_filter ('the_content',  'wpautop');

Here is some more documentation on wpautop https://codex.wordpress.org/Function_Reference/wpautop