I sometimes write dreictly in the WordPress editor. If I use another program it’s always Hemingway. It helps write better, more readable content. If you use other programs to write content before putting it into your WordPress website, the Paste As Text button should be your friend.
There is a huge problem with copying and pasting content into WordPress though. It copies underlying, invisible, and unnecessary code. In the image below, I pasted in some ForcemIpsum from Google Docs. You can see that it puts
<span> tags in there. We don’t want that. This can even make content look weird if your theme has styles those.
Microsoft Word is way worse with the code it puts into your text.
When you copy and paste content into the WordPress editor, you need to make sure to click the Paste As Text button beforehand. This will paste it without any of the formatting and code.Pasting content into #WordPress from other programs is messy. Let's fix it! Click To Tweet
Paste As Text By Default
Using a function to tie into the WordPress Editor, we can have the Paste As Text button selected by default. That way we’ll never forget to do it and the code that makes up our content will be clean.
Simply put the code below into your
functions.php file. If you’re using a child theme, use the My Custom Functions plugin and go to Tools > My Custom Functions.
Now, Paste As Text is selected automatically and you never get the funky, unwanted code from other programs.
More With The TinyMCE WordPress Editor
You can do a couple cool things with the WordPress editor. Adding a custom dropdown for styles allows you to wrap elements within the editor to make it easy for you and your clients to add certain elements.
Another detail to pay attention to is adding a custom stylesheet to the editor. Using the above technique and attaching a custom CSS file to the editor, you’ll be able to visually see the styles.