F
F
Formula_12015-10-28 11:26:41
WordPress
Formula_1, 2015-10-28 11:26:41

How to disable HTML tag scraping in Wordpress?

Good afternoon. Can you please tell me how to disable the function of clearing html tags in Wordpress?
For example, I am pasting the following code into a page:

<div itemscope itemtype="http://schema.org/ImageObject">
<h2 itemprop="name">Текст</h2>
</div>

When I save it, Wordpress cleans up the tag attributes and the following code comes out:
<div>
<h2>Текст</h2>
</div>

Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yaroslav IKARUS, 2015-10-28
@yar-ikarus

remove_filter( 'the_content', 'wpautop' ); // Отключаем автоформатирование в полном посте
remove_filter( 'the_excerpt', 'wpautop' ); // Отключаем автоформатирование в кратком(анонсе) посте

It?
Oh yes, this should be written in functions.php (in the same place where the active theme is)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question