How to Repair a Messed Up Post in WordPress

hedgehog-mascot

Most bloggers use HTML tags when creating their posts. A lot of HTML tags consist of two parts: a start tag and an end tag. When a post is displayed, all HTML elements, including tags, are parsed by the browser. Parsing is a process that browsers use to correct any user-generated HTML errors, so that the visible result is valid HTML code.

Missing End Tags

But even the parsing process doesn’t correct for all problems.

For example, if tags, such as <h3> or <blockquote> are used but there are no corresponding end tags, the resulting post is displayed all messed up.

Like this:

erroneous-html

Missing end tags

Using Close Tags

When creating your WordPress posts in the editor in Text mode, instead of Visual mode, you can use the close tags button to close out HTML tags with missing end tags.

visual-or-text-mode

Text mode

However, this feature only works for HTML tags that were started using the buttons in the editor’s menu of HTML tags.

The close tags button is not fool-proof, though. All it does is that it simply ends all tags at the point in your text where the cursor is blinking at the time of pressing the button.

Close tags button

Close tags button

In the case above, close tags will close out three outstanding HTML tags adding the following end tags: </strong>, </em>, and </blockquote>.

The end tags will be in reverse order to their corresponding start tags.

Automatic HTML Corrections

WordPress also has a nice feature that can repair HTML tag errors automatically.

To use it, go to WordPress Dashboard > Settings > Writing and tick the box next to WordPress should correct invalidly nested XHTML automatically.

wordpress-settings-writing

WordPress Writing Settings

Now, whenever a new draft of the post you are working on is saved, missing HTML tags are added to your post’s HTML code.

But remember that this tool is not fool-proof either. It will close out all HTML tags that remained open, but it will not put the end tags to their correct places.

All end tags will be placed at the very end of the document. However, this is also useful because then you will see which end tags were actually missing in the post and you can add them to their correct places manually.

Conclusion

Little errors such as missing end tags are a good reason to always save drafts of your posts and preview your creations before publishing them. Previewing draft versions of posts enables you to correct any HTML coding errors before the post is sent out to the world — potentially saving you some embarrassment.

Liked this post?

Subscribe to our newsletter to receive early notification of new posts and deals:

Next Post »« Previous Post

Leave a Reply

Your email address will not be published. Required fields are marked *