General Topics

Fix Error On Line 2 At Column 6 In Easy Steps

Fix Error On Line 2 At Column 6 In Easy Steps

Fix Error On Line 2 At Column 6: If you are worrying due to the Yoast Error on line 2 at column 6: XML declaration allowed only at the start of the document, then here I will tell you a short method to away this error immediately. The error often occurs due to issue in function.php so now we will solve this problem step by step. You just follow as under steps to rid this error. I will suggest you please visit here for rid of this error: WordPress Sitemap XML Declaration Allowed.

Fix Error On Line 2 At Column 6 Step By Step

1| Open WordPress Dashboard

First Go to your WordPress Admin Panel and hit on Appearance like shown as under:-


2| Click On Editor

Now click on Editor tab like shown as under picture:-


3| Open Function.PHP

Next step is searching your function.php, just find and click on it.


4| Use The | Sign

When you will open it then keep in mind don’t make changes if you have not any idea about it. Otherwise, you will face other errors. Just go to the end before ?> the closing tag of PHP. Now use (backspace + backslash) and you will get that sign |. Just paste this sign before this tag ?>. Hit update.


5| Remove | Sign

Now remove this sign | and hit update file.


Now check your error has removed.

Sometimes when we enter a backslash in function.php file and update this. We receive an error of 500. So don’t worry we can access this file using CPanel.

Access Function.PHP Via CPanel

Access function PHP file Cpanel. Here I am also sharing that method. Follow as under steps.

1| Access CPanel

First of all, you can access your Cpanel by visiting that URL (

Enter your Username and Password.

Search File Manager.

File Manager CPanel

Click on File Manager and now click on Go.

2| Open Public HTML Folder

Search public_html and click on it. You will find asunder. Now search wp_content.


3| Select Theme Folder

Select Themes folder.

Open that folder which theme is active.

Now Search function.php


4| Edit File

Now you can edit this file by click on edit tab or you can also click on code edit for file opening.


Lastly, you have read that how to fix Error on line 2 at column 6. Follow us on Twitter and Link us on Facebook. Good Luck!

You may also like the solution to this problem in Urdu by visiting this link XML Declaration In Urdu.

  1. How To Recognize Original Or Fake Mobile Using IMEI Number
  2. 20 Link Building Techniques for 2017
  3. 20 Top PR 9 Article Submission Website
Tagged With
Show More

Global Blurb Team

"Global Blurb since 2015" Global Blurb providing information about SEO, Beauty, Health & Fitness, Interior designing, Fashion and ways of earning online without investing a penny. The blog designed to share ideas about different topics.

Want to contribute

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button