How to Fix Sitemap Error

0
226
How to Fix Sitemap Error

How to Fix Sitemap Error

How to Fix XML declaration allowed only at the start of the document

سائٹ میپ ایرر کو کیسے فکس کریں

ایس ای او پلگ انز مثلا یوسٹ، رینک میتھ وغیرہ کا سائٹ میپ لنک اوپن نہیں ہوتا اور مندرجہ ذیل ایرر آتا ہے:

This page contains the following errors:
error on line 1 at column 399: XML declaration allowed only at the start of the document
Below is a rendering of the page up to the first error.

How to Fix Sitemap Error
How to Fix XML declaration allowed only at the start of the document

1۔اس کا آسان حل یہ ہے کہ سب سے پہلے آپ اپنی تھیم ، پلگ انز اور ہوسٹنگ کے فائل منیجر کے فائلیں چیک کریں کہ کہیں پی ایچ پی ٹیگ سے پہلے کوئی خالی جگہ تو نہیں؟ اگر خالی جگہ ہے تو اسے ختم کر دیں آپ کا مسئلہ حل ہو جائے گا۔

2۔اگر اس طرح مسئلہ حل نہ ہو تو پھر آپ کو مندرجہ ذیل فائل ڈاون لوڈ کرکے ویب سائٹ کے فائل منیجر میں اپلوڈ کرنا ہوگی۔

<?php
function ___wejns_wp_whitespace_fix($input) {
    $allowed = false;
    $found = false;
    foreach (headers_list() as $header) {
        if (preg_match("/^content-type:\\s+(text\\/|application\\/((xhtml|atom|rss)\\+xml|xml))/i", $header)) {
            $allowed = true;
        }
        if (preg_match("/^content-type:\\s+/i", $header)) {
            $found = true;
        }
    }
    if ($allowed || !$found) {
        return preg_replace("/\\A\\s*/m", "", $input);
    } else {
        return $input;
    }
}
ob_start("___wejns_wp_whitespace_fix");
?>

فائل ڈاون لوڈ

یہ فائل اپلوڈ کرنے کے بعد انڈیکس ڈاٹ پی ایچ پی فائل کو ایڈٹ کریں
سب سے اوپر پی ایچ پی ٹیگ سے آگے انٹر کریں اور اپلوڈ کی ہوئی فائل کا نام اس طرح لکھیں:

include(‘whitespacefix.php’);

اور پھر سیو کر لیں آپ کا مسئلہ حل ہو گیا ہے۔


How to Fix Sitemap Error

How to Fix XML declaration allowed only at the start of the document

Sitemap link of SEO plugins like Yost, RankMath etc. does not open and following error occurs:
This page contains the following errors:

Error on line 1 at column 399: XML declaration allowed only at the beginning of the document
Below is a rendering of the page up to the first error.

1. The simple solution is to first check the files in your theme, plugins and hosting file manager to see if there are any spaces before the php tag. If there is empty space then delete it and your problem will be solved.

2. If this does not solve the problem, then you have to download the following file and upload it in the file manager of the website.

File Download

After uploading this file, edit the index.php file

Enter next to the php tag at the top and enter the name of the uploaded file like this:
include(‘whitespacefix.php’);

And then save your problem is solved.

Leave a Reply