1

Very strange WordPress behavior: <p> tags are removed when placed inside <pre> tags, but not always. for example, this works fine:

<pre><p>This is a paragraph</p></pre>

But when the <p> tag is in its own line, it is removed. for example:

<pre>
    <p>This is a paragraph</p>
</pre>

is printed as:

<pre>
    This is a paragraph
</pre>

The context in which this is happening is inside the_loop() using the_content(). I am using WordPress 4.1

It's not a plugin issue, I've tried disabling them all.
It's not a theme problem, I tried other themes.
It's not a filter, I tried removing all filters using remove_filter and even manually using unset($GLOBALS['wp_filter'][ 'the_content' ])

What could be causing it?

  • In which context are that happening? For example: the content of single post view printed using the_content(). Please, edit your question and add this information. – cybmeta Dec 28 '14 at 11:00
  • @cybmeta the question was updated – Yoav Kadosh Dec 28 '14 at 18:01
  • I can not reproduce your problem in any way. Disable all plugins, including MU plugins (if any), as you did, use a default them (not sure if you tried with core themes or not) and clean the browser cache (just in case there is some javascript in the editor involved). – cybmeta Dec 28 '14 at 18:32
  • @cybmeta I understand. Ill try to dig into it and see if I can get more information. – Yoav Kadosh Dec 29 '14 at 22:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.