R
R
Roman Govorov2021-09-03 10:39:21
WordPress
Roman Govorov, 2021-09-03 10:39:21

How can I disable automatic tag substitution in widgets in Gutenberg in the "arbitrary HTML" block?

I insert the HTML code on the widget page into the "arbitrary HTML" block.

Gutenberg or WP substitute their tags into the HTML I write after publishing or refreshing the page:
6131ce9348081934964412.png

I tried the following solutions ( did not help ):

/**
 * Отключаем автоформатирование в редакторе WP
 */
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_widget', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
remove_filter( 'comment_text', 'wpautop' );


Also tested on a clean theme, Twenty Twenty-One, still the same problems.. inserted the following code:
<h5 class="text-start pb-3">Способы связи</h5>
<div class="phone mb-3 d-flex align-items-center mb-2">
    <img class="no-soc" alt="Телефон" src="/wp-content/themes/rgTheme/assets/img/icon-phone.svg">
    <p class="mb-0">[site_info phone]</p>
</div>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question