WordPress Error : Fix Yoast SEO Sitemap Displaying 500 Internal Server Error

Are you currently being faced with the dreaded WordPress Error displaying 500 Internal Server Error when trying to access your Yoast SEO site map? This post will guide you through fixing it.

Over the last few weeks or months, I have been doing a lot of back-end work and optimization on this blog.

Some you may have noticed, others you haven’t. As a matter of fact, this was the reason why I wasn’t very consistent with updates.

During the course of going back and forth with these optimizations, I have learnt quite a handful of new things in regards to some WordPress errors and how to fix this.

One, is how to fix the number of comments and categories not updated after importing WordPress via the importer plugin. If you are interested in that tutorial, do let me know in the comment session.

Another is how to fix Yoast SEO sitemap displaying error 500 Internal Server Error. Among others.

Based on the knowledge I have acquired as a result of trial and errors, I have decided to come up with this post which talks on how to fix Yoast SEO plugin displaying error 500 for sitemaps.

First, let’s start from the basis. Shall we?

What is Sitemap and Why is it Important?

If you have been learning the craft of SEO (Search Engine Optimization), you most likely must have stumbled on the importance of sitemaps in relating to the subject matter.

In layman’s term, Sitemap basically gives search engine bots, a better understanding for your site structure.

What is Sitemap and importance of sitemap in SEO

Of course, without sitemaps, Google and other bots can still crawl your WordPress blog. However, if you aim to help these bots understand your blog better and perhaps, help it crawl your blog better, the use of sitemaps is important.

Good crawls can positively affect your Search Engine rankings. Hence, sitemap is considered very important for the sake of SEO.

Best Sitemap Plugins For WordPress

On WordPress, there are quite a handful of plugins that can be used in creating sitemaps.

Some of these includes Google XML sitemaps, better WordPress Google XML sitemaps, Yoast SEO and even, Jetpack.

Yes, Jetpack does have a Sitemap feature. However, I don’t find myself using it. I choose to stick with Yoast for the reason being that, it already handles the technical SEO part of my blog.

Having to use two different plugins for same feature is highly not advisable. Reason being that, this can cause conflict. Besides, I try as much as possible, to keep the number of plugins on this blog, to the barest minimum.

Having known the plugins that can be used in creating sitemaps, why don’t we dive into the main subject matter.

Or perhaps, would you be interested in knowing how to activate yoast SEO sitemap? I am guessing no. I mean, for you to have stumbled on this post, you already have the sitemap feature turned on, right?

Well, if you still would like to know how to turn this on, do notify me using the comment session. I could update this post to reflect that if need be.

How To Fix Yoast SEO Sitemap Displaying Error 500 Internal Server Error

I particularly love the Yoast SEO Sitemap because, if you have less than 1000 posts, the Sitemap will be all in one page.

I find this easy to navigate through. Unlike the Google XML which tend to divide the sitemaps to different parts.

Fix Yoast SEO Sitemap Displaying 500 Internal Server Error WordPress error

While the different parts tend to reduce the number of sitemaps on the root directory, navigating through in other to reach the appropriate post or contentĀ can be a bit of a work stress. I mean that could be the same for search engine bots. I stand corrected though.

Yoast SEO on the other hand, just displays all post or pageĀ sitemaps in one page as long as content is less than 1000. When over that number, you get the post 2 directory.

In my opinion, it is much easier to work with compared to Google XML Sitemap.

For reference purpose, the default URL to access your WordPress sitemap is yourblogurl.com/sitemap.xml. For example, hubsidy.com/sitemap.xml.

If using Yoast SEO, you will be redirected to yourblogurl.com/sitemap_index.xml. If sitemap seem to appear on the sitemap.xml without redirection, please confirm not using any other WordPress sitemap plugin.

However, If accessing that page displays a 500 Internal Server Error, it’s about time we get to work.

Fix 1: Update PHP Version To The Latest

Yes, checking and if possible, updating your current web hosting PHP version to the latest should be your first point of action.

I initially had this issue till I was able to figure it out.

According to the team at Yoast, the YoastĀ SEO plugin is only compatible with PHP version 7 and newer.

Hence, if you happen to be fixed with that error, you should confirm that your hosting account is currently running PHP 7 or higher.

How To confirm?

If you are not exactly technical, you should consider reaching out to your web hosting company for help. Ask them what PHP version your account is currently running on. If still on 5, it’s about time you upgrade.

How To Change WordPress PHP Version?

Being able to do this is quite easy. For the sake of this tutorial, we will be making use of cPanel.

For most web hosting accounts, you’d most likely get cPanel as part of the package. Except of course, you are being hosted on a VPS or dedicated server without cPanel. If that’s the case, you should reach out to your hosting company for help.

To change PHP version via cPanel, follow these steps:

Step 1. Log into your control panel. This, you can do by going to yourblogurl.com/cpanel. Key in your username and password. Here is a more comprehensive guide on how to.

If this is first time, you can retrieve your cPanel details from the web hosting creation account details sent to your email. This, you should be able to find in the set up mail from your hosting company.

Step 2. When logged into your cPanel account, under software, locate and click onĀ Select PHP Version.

select PHP version under cPanel

Alternatively, use the search option (ctrl+F) and key in Select PHP version.

Step 3. On the PHP version page, you will be displayed your current PHP version. If less than 7, click on the drop down stating PHP version and select the latest or anyone with 7.

select php version to upgrade to under cPanel

I would advise selecting the highest you can find. The highest is often the latest your hosting provider offers.

However, If the highest you can find is 5, you should consult your host. If nothing can be done from their end, it’s probably in your best interest to move to a new host. These web hosting reviews can get you started.

Step 4. Having selected the PHP version you’d like to upgrade to, click on Set as current.

This will reload the page and give you the option to enable or disable different PHP modules available for the desired PHP version.

This extra process, you can skip by simply choosing Save.

Save current PHP version settings to fix yoast seo sitemap 500 error

There you have it. You’ve successfully upgraded your hosting PHP version.

Now, open incognito mode or private browsing if using Firefox or chrome. Try accessing your blog’s sitemap URL.

Did it work now? If yes, great! If no, the issue could be with your WordPress theme.

Fix 2: Check Theme Code

Did you recently try editing your WordPress theme file? If yes, you should probably undo whatever chances you’ve made to the theme files.

A good starting point is the function.php codes. Make sure you do not have any extra code placed there except you know exactly what you are doing.

Also check the single.php or content.php file to be sure there are no unnecessary white spaces and everything is intact.

In my case, I realized white spaces in the content.php file (same as single.php depending on the theme) was the culprit. So also was some codes I initially added to the function.php file which obviously, weren’t properly added. Code missing a simply closing tag as } could cause issues.

To save yourself some stress, simply activate a default WordPress theme via your WordPress dashboard. If that fixes the issue, the problem is definitely your theme.

This would be a good time to begin sourcing for some premiere WordPress themes with premium support.

Although the two fixes above should get you working, another handy place you may want to check, is the htaccess file.

Fix 3: Htaccess file

The only reason why I wouldn’t consider this as a fix is, if there is an error with the htaccess file, it affects the site structure itself and not just a plugin.

The complete blog could be displaying error 500 Internal server errors or internal pages could be displaying a 404 error not found.

In a case like this, the best option would be reverting to the default WordPress htaccess file code.

Below is the default htaccess file code for most WordPress installation.

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]


# END WordPress

You can find the .htaccess file in the root folder of the domain name under file manager. If however, you cannot find it, Click on settings under file manager and selectĀ Show Hidden Files (dotfiles) and click on Save.

If you do not know how to go about this, please consult your web hosting company or, contact me.

So, there you have it. That’s how you fix WordPress Error 500 Internal Server Error being displayed on Yoast SEO Sitemap page.

Samuel is a Tech Enthusiast who loves to explore everything that concerns Tech. Most of his explorations and guides, he shares via this platform. He studied Computer Science and prefers being simply called Sammy! šŸ˜‰