Support » Fixing WordPress » Importing post data from old version – p and br tags not working

  • bluebard

    (@bluebard)


    The company I’m working at decided to revive some old blogs that were running on a very old version of WordPress from maybe 7-8 years ago. It’s version 2.x (don’t have the exact number in front of me).

    The new sites unfortunately can’t utilize PHP 7, so we had to go with WordPress 5.1.4. I’ve been told they can’t update to PHP 7… Still, it’s usable.

    Anyway, the actual text content is all there and I can even see the P and BR tags in the posts. The problem is that the posts themselves don’t have those tags appear anywhere in them in the actual page.

    It seems like some kind of different post format that just needs to be updated to the newer one.

    We are using the Classic Editor as well as the TinyMCE plugin. Prior to TinyMCE, P tags were never appearing in new posts and everything was all on one line. With TinyMCE, it seems like the P tags do appear correctly in new posts (after checking the option to enable them).

    For older posts, they have P and BR tags, however when viewing the posts on the page, these are stripped out and I don’t understand the reason. I have noticed that simply editing and saving the files seems to be required to get P tags to work. BR tags do nothing, however. Most posts need further editing.

    One fix is to just go in and put in the line breaks manually, however there are tons of posts and this will take too long.

    With PHP, nl2br won’t work as that’ll put unnecessary BR tags where ANY line break happens, which is unintended behavior. I also can’t imagine doing some insane regex on older posts…

    Is there any way to do a quick fix on old post data? Preferably one that can specify a date range of posts?

    Any help appreciated. Thanks in advance.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Importing post data from old version – p and br tags not working’ is closed to new replies.