Support » Fixing WordPress » Line Breaks Broken After Import from WordPress.com

  • Resolved pxabstraction

    (@pxabstraction)


    Hey all.

    So I have a problem here that’s driving me nuts and I’m hoping you fine experts can assist.

    I’ve decided to get my blog off the overpriced WordPress.com and am moving it to a WordPress.org installation through a hosting provider. I did the export and import into the new platform but it’s been a mess. A ton of stuff that should have migrated didn’t and a bunch of the theme options that are in WordPress.com are mysteriously missing from the WordPress.org version. I’ve managed to correct almost all of this through CSS adjustments but, one problem I cannot figure out.

    This blog has had the vast majority of its 192 posts written in the old Classic Editor. I didn’t write a new post for some time so only the last couple have been written in the new editor. Anything that was written in the Classic Editor has all its extra line breaks between paragraphs missing. So rather than paragraphs showing like this:

    Paragraph A

    Paragraph B

    They all show as this:

    Paragraph A
    Paragraph B

    The only solutions I’ve managed to research for this problem involve installing plug-ins prior to export that WordPress.com won’t let me use. Other than that, it involves going back and hand fixing 190+ posts which will take hours upon hours upon hours.

    Does anyone know if there’s a way to either correct this or to do another export from WordPress.com that will not cause this bug? After fighting with this all day to make up for all the things WordPress.com refused to transfer, the thought of manually fixing all these posts makes me want to flip a desk. 🙂

    If anyone has suggestions, I would greatly appreciate it. Thank you very much!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Can you please post a link to your current site? If your old WordPress.com site is still up, a link to that would help as well. May be all you need is to add a CSS rule that adds a margin-bottom property to your paragraph tags.

    Hey there, thanks for your help!

    The current site is at https://geekbravado.com. The new one is still just in staging so it’s not live on the domain yet.

    If you want an example of a post that looks fine on the current site but has the paragraph lines break on the new site, here’s one:

    This is an older post but basically any post newer than the most recent three have this issue.

    Thanks! 🙂

    On your old site, I see this rule:

    
    #content p, #content ul, #content ol, 
    #content dd, #content pre, #content hr {
        margin-bottom: 24px;
    }
    

    So you can try adding this rule (Appearance → Customize → Additional CSS) to see if it fixes the problem.

    I shall try that in the morning and report back! Thank you very much!

    So, I added that CSS to the custom section of the theme (along with all the other things I had to add to band-aid the migration from .com), but sadly, it didn’t seem to work. 🙁

    This is a snippet of the sample post running on my .org testbed after adding it.

    Here is all the custom CSS I currently have, including your suggestion. All of these are to reinstate stuff in the theme that was lost in the import from .com to .org.

    #site-description {
    display: none
    }
    #site-title {
    display: none
    }
    a:visited {
    color: #890000;
    }
    a:link {
    color: #d50000;
    }
    a:hover {
    color: #890000;
    }
    #access {
    background: #000;
    display: block;
    float: left;
    margin: 0 auto;
    width: 940px;
    position: relative;
    text-align: center;
    }
    #access ul {
    display:inline-block;
    }
    #content p, #content ul, #content ol, 
    #content dd, #content pre, #content hr {
        margin-bottom: 24px;
    }

    Thank you for your help! 🙂

    Unfortunately, it’s very difficult to tell what rules to make just from looking at a screen shot. What theme is your new site using? I see that the old site is using Twenty Ten.

    Just FYI, the production site is currently what’s online. In order to get a couple of things setup, I had to bind it to the domain. However, the broken paragraph breaks are the only issue remaining it seems.

    Both sites are using Twenty Ten. I’m planning to move the site to a new theme eventually but not yet. The problem is, the version of Twenty Ten on .com has a ton of options and other things that the .org version doesn’t, even though it was updated very recently. This disparity between the paid and free versions seem to be where this has broken down. I had to manually edit the theme on .org in order to restore the font, remove the site title and tagline fields and several other things that just didn’t move over in the migration.

    If there’s anything I can provide from the old site that might help, I’m happy to. I feel this is likely an easy tweak to make but I have very little experience in this stuff. Given the problem only happens to posts made in the Classic Editor, I assume there’s something involving that which is missing from the version of Twenty Ten the .org site has. I did try installing the Classic Editor plug-in to see if that would help in some way but it didn’t make any difference.

    OK, sorry, I misunderstood. I thought that the link you posted was for your old site, not your production site.

    I took a look at one of your older posts, and I see the problem. What happened was that the “paragraphs” aren’t actual separate paragraphs. Instead, it’s just one huge paragraph with line break <br /> tags put in to break the next line from the previous one. That is, instead of something like this:

    
    <p>This is the first paragraph.</p>
    <p>This is the second paragraph.</p>
    <p>This is the third paragraph.</p>
    

    It looks like this:

    
    <p>This is the first paragraph.<br />
    This is the second paragraph.<br />
    This is the third paragraph.</p>
    

    If you do a “view source”, you’ll see what I mean.

    You can’t fix it using CSS, because most CSS doesn’t have any effect on <br /> tags. You can copy the contents of the post into a text editor and replace all instances of <br /> with </p><p>, but that would be very tedious. I’m going to see if there’s a javascript solution that will replace those line break tags with the closing/opening paragraph tags when the page gets loaded.

    Thank you very much for your help, it’s greatly appreciated.

    What I think I’m going to do in the mean time is go and manually fix the evergreen posts that still get a lot of hits. And I’ll probably just fix 2-4 a day after that until it’s fixed.

    It’s really frustrating what a mess getting a blog out of WordPress.com is but the huge amount I’m saving per year is worth a few hours of tedium. 🙂

    If you do find a more automated solution though, I’d love to hear it. Thanks again!

    So just FYI, I sucked it up, put Brooklyn 99 on the TV and manually corrected all my posts. It was a slog and I was cross-eyed afterwards but it’s finally done and I gleefully hit the cancel button on my WordPress.com subscription. Turns out that some of the images in my posts were broken too so it gave me a chance to fix those as well.

    Thank you again for your attempts to help me, it’s greatly appreciated. 🙂

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.