0

When I paste from word, it adding a lot of extra spacing around each block of text. If I look in html editor, it's putting a <strong> </strong> in between each block of text, which makes it have a lot of spacing, much more than how it looks in word.

Does anyone know how to fix this? Note: I am using wordpress 4.7.2

Word is on the right side, wordpress is on the left side.

enter image description here

Wodpress code that got pasted

<ol>
    <li><strong>Gsfdfdfgdfgdfgdfg</strong></li>
</ol>
<strong> </strong>

The author reports

<strong> </strong>
<ol start="2">
    <li><strong>Dfgdfgdfg</strong></li>
    <li><strong>dfg</strong></li>
</ol>
0

I dont know exactly why word adds html tags around elements but i do know how to fix it.

You should first copy the content from the word document and paste it into a text editor like notepad++ which does not add HTML tags. Afterwards you can just copy it and paste it into the wordpress editor without any tags.

  • If I did that, it would remove all formatting right? I still want it to preserve things like bold, italics, underline, lists, hyperlinks. Just not add those empty strong tags. – omega Feb 28 '17 at 16:21
  • I added a picture above to show how it looks. – omega Feb 28 '17 at 16:26
  • It might be because of the line-height that's set on your editor-style.css. I just tried to do the exact same on the twenty seventeen theme and it looked almost the same. – Bas Grave Feb 28 '17 at 16:30
  • I can open the editor-style.css, but which line-height do I change? – omega Feb 28 '17 at 16:37
0

Pasting from Office to WordPress is never a clean experience. There are two options: paste as you're doing and clean up the code later (manually deleting the <strong> </strong> tags and other bugs), or do as Bas Grave suggested and strip all formatting, then use WP to reformat it. The reason is creating more space is that the space character between the tags adds an extra line.

As you can see from the <ol start="2"> tag WordPress is interpreting item #2 as a completely separate list, which is not good for accessibility or search engines. Stripping the formatting and adding it back in carefully is the safest way to ensure things appear as you want them to - and appear cleanly for screen readers and spiders too.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.