How to stop Writer from putting “bloated” html code on Wordpress? (Text is copied from Writer, then pasted on Wordpress’ Visual editor.)


First, some preliminary details:

  • OS: Linux Mint 19.1 Cinnamon (1 month old. I’m a noob.)
  • LibreOffice version:
  • File format being used: ODT, DOCX

I always write on a word processor first (offline) before copy-pasting it on Wordpress. Writing directly online doesn’t work for me.

I do all the formatting on the word processor (which are usually only bold, italic and paragraph spacing).

On Wordpress, format-wise, I only put the heading tags. I always use the “Visual” editor.

I checked the “Text” editor after I noticed that the headings were not rendering their corresponding CSS (font-size, mostly).

Same thing happens whether the text I copy is from an ODT or DOCX. (I mostly use DOCX because I have another PC that runs Windows, on which I’m not planning to install LO.)

So… (just to be clear) here’s what happens: I copy all that I wrote on LO Writer, paste it on Wordpress’ “Visual” editor, and then click the “Text” editor tab, where I see all these “bloated” html codes, particularly:

<p class="western"><span style="font-size: medium;"><span lang="en-US">Sample text here.</span></span>

This set of code is present in EACH paragraph.

Thank you.

LibreOffice puts the copied part in various formats into the clipboard. Use a clipboard viewer to see these. It is up to the target application to take that format, that is useful in its context.

Thanks Regina. I just installed Clipit and will be looking into the clipboard. I’m just looking for a way for Writer to use “simpler” html with basic copy-paste. MS Word does it. MS Word yields something like <p>Sample text here.</p>. It would be time-consuming to edit a lot of heading html’s on the Text editor just to remove that font-size that Writer imposes. (I prefer Wordpress’ Visual editor much, much more than Text editor.)

How to stop it any way?
What should i do to paste <p>Sample text here.</p> not <p class="western"><span style="font-size: medium;"><span lang="en-US">Sample text here.</span></span></p>?

To get something like

Sample text here.

use a simple text editor like the Windows Notepad or a Real HTML Editor LibreOffice and ApacheOpenOffice are not meant for making HTML, They are designed as free Office Suites.

Maybe you do not understand why people go to the support service with similar questions. To make it clearer, I will describe the process in more detail. I order articles from people from different countries of the world as my websites are multi-language. They all use different text editors for writing articles. Someone uses Windows (MO), someone Linux (LO). When I copy the already-marked text (meaning headings and paragraphs) into a new article (WordPress), I get a ton of extra css code (even more than words in the article). To avoid this, I first copy the text into a simple text editor and then into a new article. Further, I myself mark everything according to the idea of ​​the author. This is called extra work. The question is how to avoid this. How to copy tagged text from LibreOffice without unnecessary code. How to avoid unnecessary work that takes a lot of time when viewed globally. I hope you now understand the reason why I’m talking to you.

From your answer, I understood only that LibreOffice is not able to resolve this situation as you advised to use another text editor. I apologize for the mistakes because English is not my native language.

The people here like myself are only other users like you. No paid Tech Support here.

As someone who uses Wordpress, I’ve given up pasting directly on its Visual Editor. I now paste everything first on the Text Editor and then shift to Visual for formatting. I’ve found that html is sort of a universal thing. It may be cumbersome especially if like me you prefer the Visual Editor, but a piece made with html can be used/pasted anywhere on the web. (Well, there’s markdown or whatnot, but I don’t use it.) Maybe look for a solution in which everybody could use and see everything–format-wise–like a text editor. I think you could create a system for that on Wordpress, too. I feel that using the Text Editor makes things way cleaner (gets rid of those “bloat html”). I agree on the comment that Office Suites aren’t really designed for or compatible with the web’s structure. For web writing I just use a .txt app (not LO Writer anymore) and go from there. Hope that helps.