August 7, 2014

WordPress HTML Formatting Problems


For the most part, WordPress correctly formats posts and pages. There is that odd time, when a bug just completely destroys our post or page formatting. WordPress uses a formator called wpautop which puts paragraph tags around everything in the post or page. Most of the time, this works perfectly, but sometimes, this just completely wrecks the formatting of the page.

The Solution?

If you are experiencing a lot of issues with formatting with a specific post/page, I would suggest not using the Visual editor, and simply sticking to the Text (HTML) editor.

One of the most useful plugins for solving formatting problems, is a plugin called Text Control. It allows you to have full control over how you would like to format each individiual page and post. Once activated, it allows you to choose from a variety of formatting syntaxes and encoding options. You can choose the following for formatting:

  • Markdown
  • Textile 1
  • Textile 2
  • nl2br
  • WPautop
  • “No Formatting”

Along with the choice of the following for character encoding:

  • SmartyPants
  • WPTexturize
  • “No Encoding”

Once installed, the Text Control plugin will appear bellow your post and page editor. Once Published your formatting setting will be applied

For many of my posts I choose No Formatting simply because it is easier to maintain and much more predictable.

I’d love to know if this helped you out, or if you have any questions. So please leave a comment below.

Share this Post
Share on FacebookTweet about this on TwitterShare on Google+Share on TumblrPin on PinterestShare on Reddit