How to Remove errors in My Website Code

  1. List item

Hi Dear friends. I am looking solution to rectify errors in my website code. My each page has more than 70 errors. When I try to solve the errors, website design alignment get changed. Please help me to resolve errors in my website. My website link is

Validation errors at

Hello @mchrish58 The errors are usually self-explanatory. I doubt anyone will go through all 70 errors with you.

Take the first error. It is saying you have a closing</div> but there is no opening <div>.

See how you get on with them applying logic, and let us know if you have any problems.


I noticed that PHP is being used and the page is quite lengthy.

I would be tempted to:

  1. split the page into sections
  2. save each section as a separate file
  3. use the following template
  4. include sections one at a time until all errors are removed
  ini_set('display_errors', 'true');

$validate = '';

 include 'section-header.php'; 


  <?php  include 'section-001.php'; ?>
  <?php  include 'section-002.php'; ?>
  <?php  include 'section-003.php'; ?>
  <?php  include 'section-004.php'; ?>
  <?php include 'section-footer.php'; ?>

  <a href="<?= $validate ?>" > Validate </a>


Added section-header.php

Yes, as @Gandalf says, you need to work through these one at a time. There really is no other way. Once you’ve corrected a few, then revalidate the page, as sometime fixing one error also resolves later errors. If you come across a particular error message you don’t understand, then ask for clarification. Once you’ve corrected all the errors, if there are problems with your layout, we can help you with those.

1 Like

Yeah friends. I have tried all your answers. When I remove or add

my design gets changed. It’s very simple codes. But very difficult to identify where it start and closed.

As I said, once you’ve fixed the errors in the HTML, we can help you sort out any problems which have arisen in the layout. You just need to fix the errors first.

Sometimes I use this technique … if you ‘view page source’ in Firefox, the browser will often display incorrect tags in bright red, so it helps to locate some of the errors quickly. Try working on these tags to get rid of the bold red text and then validate your code. For example, right at the top of the page is the </div> that has no corresponding opening tag. Remove it. Then continue on down the page.

There’s really no point worrying about the layout of the page if it has been done incorrectly. That’s why you are being advised to fix all the errors first, then we will help you do the layout correctly without any errors.


Of course, the best way to avoid troublesome situations like this is to validate your code as you write your page(s) rather than treating validation as an afterthought.

If necessary, start over from scratch and validate the page(s) as you add code to them. Validating frequently allows you to catch errors before they accumulate into a frightening mess.


A lot of those are simple html errors with mismatched tags and are relatively easy to solve especially as the validator tells you which ones they are. You need to fix (match up/place correctly) the tags properly first and then start on the other errors. Of course I don’t suppose that is straight forward in Wordpress as you probably have chunks of code being dragged in from all over the place. However, I guess it is up to you to make sure that each section is well formed from the start.

Some of the errors are pretty simple such as duplicate ids and they need to be made unique as you can only use the same id once on a page. There are also quite a number of errors for the itemprop attribute so you need to look that up and check for the correct way to use that html. I’m afraid I don’t do WordPress so its something you will need to delve into yourself.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.