Trouble-shooting your blog's invalid code

If your code comes back from the validator as invalid, it will give you a list of the errors. If there are only one or two, it should be easy to fix. If there are many errors, run this test to find out where they are coming from.

Create a small post that is just a very simple sentence. Like:

This is a blog test.

Do not include any links, any line breaks or unusual characters. Don't create it in a word processor. Post it to your blog in the most direct manner that your blog software allows. Then navigate through your blog (just as a visitor would) until you are viewing just that post. Copy the URL and paste it into the above validator.

If it validates, the posts you are writing are probably not valid. That is good news, because it is a easily fixed compared to a glitch in your blog software tool or a template problem.

Fix this by opening up each one of your posts in your blogging tool and copying the contents of that post into a plain-text editor such as Notepad, then copying to back into the blog tool from the plain-text editor. Try revalidating your blog index page. If the problem was with your entries, it should validate now. If not, the problem may be with your blogging tool.

If that small post page comes back invalid, your template is invalid, sometimes called the skin. This is fixable, but requires digging in. If you know what you are doing, you can open up the template pages to find and correct coding errors directly. Or you can try switching to a different template that is known to validate. In any case, make a back-up first.

Points in the process where the code can become invalid are:

  1. The template or skin for your blog can be coded badly.

    This is easily fixed, as the template is always available to you to edit or replace with another.

  2. You can create entries into that blog that contain additional non-standard mark-up. For instance, if you post by email or if you use a word processor to create your posts. If this problem recurs, the program you are using to create your posts is adding invalid code to your posts.

    You can fix this by writing all of your posts directly into the blogging tool. If you don't want to stop creating the entries elsewhere, make sure your posts arrive to the blog software in plain text bby checking your settings. And don't try to add tags into the post by hand, instead use the buttons the blogging tool provides (which are standard XHTML) for adding links, bolding text, etc. That should solve the problem.

  3. The blog software turns those entries into XHTML posts but it doesn't do it properly. Yes, this really can happen. If you make the code valid in your templates and make entries directly into your blog software, but the same errors keep coming back to haunt you, it means that your blog tool is generating invalid XHTML code.

    The solution is to contact your software provider's tech support for assistance or switch blog software.

Return to the blog optimization page.

invalid XHTML Code

Summary: Blog code is XHTML. This page talks about what to do to your blog to get your code to validate.

Any time you edit your blog's templates, we recommend following standard procedures for safety and data protection. First make a back-up, then make your changes on the current version (not the back-up), then carefully check that the changes produce the desired result, then look for whether or not those changes caused anything umplanned to happen to your blog.

As usual, consult a professional if you're not sure what to do.

This page last updated 2019-02-20.

Home Design SEO Marketing Writing Tools Books Clients Contact Email Lists

SEO by Words in a Row