[OFFER ALERT!] This Halloween, Get Any Premium Theme for Just $19 [GET IT NOW]
Jump to content

[Rank Math SEO Plugin] Sitemap.xml Not Working


brian140
 Share

Recommended Posts

Getting an error with the sitemap as follows:

This page contains the following errors:

error on line 2 at column 6: XML declaration allowed only at the start of the document
Below is a rendering of the page up to the first error.

I have re-saved the Permalinks on all the other websites and that has fixed it on them, but not on this website for some reason?

Perhaps it's just a caching issue my end?

Thanks.

Link to comment
Share on other sites

Reply from Siteground below. It wasn't Rank Math after all, but I think you knew that!

Thanks for all your help.

I have tried to insert the code in the .htaccess file of the website but it is breaking the application and the website returns error 500 when this rule is present.

The actual issue was that your index.php file did not begin with an opening php tag but with a blank space. I delete the row with the blank space and now the sitemap is loading properly:

https://www.quickandfriendlyloans.com/sitemap_index.xml

If this occurs on any of your other websites you can check the index.php file of the website and remove any blank spaces in the beginning of the file.

If there is anything else we can help you with, please contact us again by posting a new ticket.

Best Regards,

Adem Sherifov
Technical Support Team

Link to comment
Share on other sites

  • Support

Hello,

Thank you for contacting MyThemeShop today.

Please share your login details in the "Sensitive Data" section by editing your first post on this ticket and follow the instructions shown in the screenshot below:
sensitive.jpg

Please make a reply once you update the details, so we get notified.

Looking forward to helping you. Thank you.

 

 


🏁Rank #1 on Google With our WordPress SEO Plugin.

Score a 💯on PageSpeed and Dominate Search Rankings.

✏ Editing theme files? Please create a child theme to make your changes update-proof.

Link to comment
Share on other sites

  • Support

Hello,

The error you are getting on the sitemap typically happens when a plugin or theme function incorrectly adds an empty whitespace at the beginning of the sitemap. Please view the source code of your sitemap: http://take.ms/FDhMQ

The cause most often is an empty line at the beginning or end of the wp-config.php or functions.php file. I checked functions.php file from the admin-panel and there were no empty lines there. Please check if there are any empty lines in the wp-config.php file. If there is no empty line in that file, we highly recommend running a Conflict check to identify what outputs the empty lines. To run conflict check, please follow the below steps:

  1. Log into your WordPress Administrator, and navigate to the dashboard
  2. Navigate to 'Plugins', and go to 'add new'
    T9Ch6
  3. On the next page, enter 'Health Check' in the search bar and wait for the screen to refresh
    d0qdd
  4. The official Health Check plugin by WordPress.org should be visible as the first result. Please install and activate the plugin
    OP6bX
  5. You will reach the plugin page automatically, and a notice will appear. Click 'I understand' to continue
    kmNot
  6. On the WordPress Menu on the left, hover over the dashboard. You will notice a new 'Health Check' option, click on it
    j3RNi
  7. On the page that appears, there will be several tabs. Please navigate to the 'Troubleshooting' tab
    To02q
  8. Press the 'Enable Troubleshooting Mode' to start the troubleshooter
    zDFyO

Once you complete these steps, you are in troubleshooting mode. All the plugins on your website have been disabled only for you. Your theme has also been disabled, but only for you.

To diagnose the root-cause of your problem, you would enable each plugin one by one until an issue is found. The last plugin that causes the issue will probably the cause of the conflict. Here are the steps in more detail.

  1. With all plugins and the theme disabled, try reproducing the issue.
    1. If you still have the issue, your WordPress setup is the root of the problem.
    2. If not, then continue.
  2. On the top bar, navigate to the 'Troubleshooting Mode', hover over it, and enable the MyThemeShop plugin in question. After that, try to reproduce the issue. u7oyK
    1. If you have the issue, the plugin is conflicting with WordPress
    2. If not, then the plugin is not causing issues with WordPress. Continue to the next step
  3. Navigate to the "Troubleshooting Mode" in the top bar again, and enable any other plugin. Then try reproducing the issue. qHIDj
    1. If you have the issue, then the plugin you just activated is conflicting with the MyThemeShop Plugin
    2. If not, then this plugin is not causing issues with the MyThemeShop plugin

Repeat step no 3 by enabling one plugin at a time and checking if the problem exists. When the problem happens, the plugin you last activated is causing the issue.

 

If the issue is still not resolved, then it might be an issue with the theme you are using. Here is how you confirm if your theme and the MyThemeShop plugin are conflicting with each other.

  1. Enter troubleshooting mode again using the instructions above.
  2. Using the Troubleshooting mode, activate your regular theme by selecting the 'Use your current theme option'. kY14f
  3. Activate the MTS plugin you want to check and try to reproduce the issue. u7oyK
    1. If the issue appears, your theme conflicts with the MTS plugin.
    2. If not, then the issue is with another plugin. You can continue enabling other plugins to pinpoint the plugin and contact their support for a resolution.

Once you complete the above steps, please let us know. Looking forward to helping you. Thank you.


🏁Rank #1 on Google With our WordPress SEO Plugin.

Score a 💯on PageSpeed and Dominate Search Rankings.

✏ Editing theme files? Please create a child theme to make your changes update-proof.

Link to comment
Share on other sites

I checked and there were no spaces at the top of any of the wp-config.php files.

Went through the Health Check options but still got the error with all plugins disabled.

I am using your Schema Theme on all websites so there should be no conflict there?

 

I just tried to deactivate the Rank Math plugin and then reactivate it again to see if that might help but the plugin will not deactivate!

 

The sitemap url seems to be diverting to the index page now for some reason

 

So, it now looks like all the other websites are working fine and it is only the quickandfriendlyloans.com website that is not producing the sitemap page for some reason?

 

Now none of the sitemaps are working again!

I havent had any updates for a while?

Link to comment
Share on other sites

  • Support

Hello,

Did you try other plugins and check if their Sitemaps are showing up? Like, Yoast's?

Looking forward to helping you. Thank you.

P.S. If you would allow, I can do that testing for you quickly.


🏁Rank #1 on Google With our WordPress SEO Plugin

Score a 💯on PageSpeed and Dominate Search Rankings.

✏ Editing theme files? Please create a child theme to make your changes update-proof.

Link to comment
Share on other sites

  • Support

Hello,

I checked further and noticed that even Yoast's Sitemap wasn't working either.

I can see some extra spaces are showing up in your page's HTML.

Even though the sitemap is loading fine for the Google bot.

Can you please ask SiteGround's support to check on their end if the Apache rules are added correctly?

I have included the link in the sensitive area which you can show to them.

I already tried reverting to the default theme and deactivating all the plugins, but nothing helped.

Looking forward to helping you. Thank you.


🏁Rank #1 on Google With our WordPress SEO Plugin

Score a 💯on PageSpeed and Dominate Search Rankings.

✏ Editing theme files? Please create a child theme to make your changes update-proof.

Link to comment
Share on other sites

Reply from Siteground:


Thank you for contacting our help desk!

As requested I've checked on the Apache rules that are saved within the .htacess (web-server) configuration file of your website. However everything is properly set up as far as I can see. Here's a breakdown of the contents of the said file:
 

Code:

-> The code that enables PHP version 7.1
AddHandler application/x-httpd-php71 .php .php5 .php4 .php3

-> Redirection from http:// to https:// 
# HTTPS forced by SG-Optimizer
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
</IfModule>
# END HTTPS

-> Default WordPress code 
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

-> Leverage Browser Caching 
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/javascript "access 1 month"
ExpiresByType application/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES CACHING ##

-> Gzip Compression 
## ENABLE GZIP COMPRESSION ##
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
## ENABLE GZIP COMPRESSION ##



In this case I'd recommend updating the support of the plugin and providing them with the lines above. This way they can check if there are any rules that are interfering with their plugin and assist you in resolving this issue. We'll be happy to assist with any suggestions and recommendations that they may have. 

We're online 24/7 so you're always welcome to reach us back at your convenience. 

Best Regards, 

Todor Ivanov 
Senior Technical Support

Link to comment
Share on other sites

  • Support

Hello,

Can you please request them to add the following code as well?

# Rewrites for Rank Math SEO XML Sitemap
rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;

Looking forward to helping you. Thank you.


🏁Rank #1 on Google With our WordPress SEO Plugin

Score a 💯on PageSpeed and Dominate Search Rankings.

✏ Editing theme files? Please create a child theme to make your changes update-proof.

Link to comment
Share on other sites

Reply from Siteground below. It wasn't Rank Math after all, but I think you knew that!

Thanks for all your help.

I have tried to insert the code in the .htaccess file of the website but it is breaking the application and the website returns error 500 when this rule is present.

The actual issue was that your index.php file did not begin with an opening php tag but with a blank space. I delete the row with the blank space and now the sitemap is loading properly:

https://www.quickandfriendlyloans.com/sitemap_index.xml

If this occurs on any of your other websites you can check the index.php file of the website and remove any blank spaces in the beginning of the file.

If there is anything else we can help you with, please contact us again by posting a new ticket.

Best Regards,

Adem Sherifov
Technical Support Team

Link to comment
Share on other sites

  • Support

Hello,

It was a pleasure helping you. We are glad you found our help useful. If you have any other questions in future, do let us know. We are here to help you.

Could you please leave us a testimonial (if you haven't already done that) on about your overall experience with MyThemeShop? This will help us serve you, our members, better. We appreciate your time and patience.
https://community.mythemeshop.com/forum/6-testimonials/

Thank you in anticipation.


🏁Rank #1 on Google With our WordPress SEO Plugin.

Score a 💯on PageSpeed and Dominate Search Rankings.

✏ Editing theme files? Please create a child theme to make your changes update-proof.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...