Yoast XML Sitemaps on NGINX servers

Yoast XML Sitemaps on NGINX servers

Our plugin generates sitemaps dynamically when you enable the sitemap feature. In some cases, you may need to add server level rewrites if you receive an NGINX server error or a wrong page when loading the XML sitemaps.

If you are using Apache, please use the rules here. If you are not sure which you use, please speak to your host provider. 

Table of Contents

Do I need to add rules?
Still not working?
What are the rules?

How do I know if I need to add the rewrite rules?

The Yoast SEO XML sitemap URL uses a pretty permalink of example.com/sitemap_index.xml but, behind the scenes, this URL also has a non-pretty permalink version of example.com/?sitemap=1. If you can load and see the sitemap using the non-pretty permalink, your server is not setup to rewrite and, thus, you』ll need to add rewrite rules.

What are the NGINX rewrite rules?

Here are examples of the rewrite rules you may need on NGINX servers. If you』re unsure where to add these rules, please contact your webhost or server admin for assistance.

If you already have rewrites in your NGINX config file, you can add these to the same section using the basic code. If you do not have rewrite rules or have an add-on like News SEO, you may need part or all of the expanded code further below.

Basic Code

# Rewrites for Yoast 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;

Expanded Code

#Yoast SEO Sitemaps
location ~ ([^/]*)sitemap(.*).x(m|s)l$ {
## this rewrites sitemap.xml to /sitemap_index.xml
rewrite ^/sitemap.xml$ /sitemap_index.xml permanent;
## this makes the XML sitemaps work
rewrite ^/([a-z]+)?-?sitemap.xsl$ /index.php?yoast-sitemap-xsl=$1 last;
rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
## The following lines are optional for the premium extensions
## News SEO
rewrite ^/news-sitemap.xml$ /index.php?sitemap=wpseo_news last;
## Local SEO
rewrite ^/locations.kml$ /index.php?sitemap=wpseo_local_kml last;
rewrite ^/geo-sitemap.xml$ /index.php?sitemap=wpseo_local last;
## Video SEO
rewrite ^/video-sitemap.xsl$ /index.php?yoast-sitemap-xsl=video last;
}

Remember that you might have to modify this if you are running WordPress in a subfolder.

Still not working?

If you』ve added the redirects above and the pretty permalinks do not load, the issue is likely to do with other settings on your server. Please contact your
webhost or server admin for assistance.

Help beacon notification

Help beacon notification

With the introduction of Yoast SEO 12.6 we replaced the old Help Center with a new beacon. This beacon has some very cool features. Make sure to check them out in the 12.6 release post!

The beacon can be found in the bottom-right corner on every page in our plugin.

However, before you are able to use this beacon, you will need to confirm that you are ok with using it. A notification will pop up when you click the beacon.

After selecting 『OK』 you are good to go!

My Yoast SEO plugin does not have the beacon!

That』s definitely not good, you』re missing out! There are two major reasons why this could be the case. They are listed below:

You have not yet updated to the 12.6 version of the plugin. Please check the plugins page on your website to confirm you are on the right version.Some ad-blockers block the beacon completely, meaning that you don』t even see it. Make sure to either disable the ad-blocker or whitelist your own website in the ad-blocker.

Edge case

There is one special case when using the Microsoft Edge browser. When the notification has been dismissed twice, the browser will ask if you want to stop the page from creating more messages. If you agree to that, then it is no longer possible to open the beacon at all. In order to resolve this, the browser needs to be restarted.

Page Analysis Has Been Disabled

Page Analysis Has Been Disabled

This message will appear when a theme or plugin developer turns off the functionality by adding a line of code to their product.

If you are unsure which plugin or theme disabled this feature, please check for conflicts using the steps in this article.

Usually this means the plugin or theme』s content is not accurately analyzed by our plugin and the developer has opted to disable the feature. Please contact the developer of the plugin or theme for additional information on why they disabled the feature.

You Should Add [XYZ] to the httpd Config File

You Should Add [XYZ] to the httpd Config File

The warning:

As you』re on Apache, you should add the following include to the website httpd config file: Include /Path_To_WordPress/wp-content/uploads/wpseo-redirects/.redirects

The Cause

When you disable PHP redirects and generate a separate redirect file, the plugin writes all redirects to a custom file. However, your server doesn』t know to use the custom file. The included command tells the server to use the custom file.

The Solution

Your webhost or server administrator can provide instructions on how to edit the httpd config file for your website.

Due to security reasons it is not possible for the plugin to check the full pathway of the server. This means even if you know you added the pathway to your httpd.conf file the message will still appear.

URL Redirects With Encoded Characters

URL Redirects With Encoded Characters

Unusual looking URLs cause a lot of confusion as to the best practice for redirecting them when using Yoast SEO Premium. Our plugin will accept both the encoded and unencoded character.

If the redirect is not working with the one version character, try substituting the other version.

Encoded CharacterUnencoded Character%E2%80%A6…%20(space)%25%

A complete list of encoded characters is available here.

My redirect with UTM parameters isn』t working

When PHP redirects are enabled, URLs with UTM parameters are not redirected. This is what regex redirects are for. If you』re using utm with a ?, it truly is a parameter, so it shouldn』t be redirected. We suggest using # based UTM links or creating regular expression redirects.

Fatal error: Call to undefined function filter_input()

Fatal error: Call to undefined function filter_input()

The error:

Fatal error: Call to undefined function filter_input() in /PATH_TO_WORDPRESS/wp-content/plugins/wordpress-seo-premium/PATH_TO_FILE.extension on line ###

This errors means that your webhost has actively disabled the PHP filter extension which is shipped with PHP and enabled by default. Unfortunately, unless you』re an administrator on the server, you can』t solve the problems yourself.

The Solution

Please contact your webhost and ask them to fix these issues.

Warning! [XYZ Plugin Name] might cause issues

Warning! [XYZ Plugin Name] might cause issues

The warning:

The [XYZ Plugin Name] might cause issues when used in conjunction with Yoast SEO.Both Yoast SEO and [XYZ Plugin Name] create OpenGraph output, which might make Facebook, Twitter, LinkedIn and other social networks use the wrong texts and images when your pages are being shared.

Cause

When you activate Yoast SEO or Yoast SEO Premium, we scan your active plugins for potential OpenGraph conflicts. If you see this message, the plugin listed in the warning may also output OpenGraph tags. This type of conflict, while not detrimental, can cause a lot of headaches when sharing content on social media sites.

Solution

We recommend selecting one plugin to generate OpenGraph tags for best results. Duplicate OpenGraph tags can cause social media sites to display incorrect titles, descriptions, or images.

If you want to use our plugin to generate OpenGraph tags, please disable the OpenGraph feature in the other plugin. Please contact the developer of the conflicting plugin for information on how to disable OpenGraph in their plugin.

You do not have to deactivate the conflicting plugin if you can prevent the plugin from outputting OpenGraph tags.

If you want to use the other plugin to generate OpenGraph tags, please disable the OpenGraph feature in our plugin.

Google Search Console: Video Schema Report

Google Search Console: Video Schema Report

We will use the term 『error』 throughout this article but please note that the same process can be used for warnings that appear in Google Search Console.

Google Search Console notifies webmasters of issues with their video schema. If your site』s video schema report shows errors, we』ll help you determine where the issue occurs and which support team can help you resolve the issue. Determine which product on your site outputs the video markup Yoast SEO (free or premium) does not output video schema. However, if you have the Yoast SEO: Video add-on, it will output video schema automatically.If you are not using the video add-on, something else on your site has added the video markup. Please contact the team for the product that adds video schema for assistance resolving the issue. Not sure which product adds video schema for your site? A conflict check can help.If you are using the video add-on, there is a chance that something else adds their own video markup as well. So we』ll next check if the video error is located inside the Yoast SEO video markup. Determine if the error occurs inside the Yoast SEO video markup We』ll walk you through this process step by step below. Before starting, you will need to have at least one URL that is listed in the Google Search Console as having a video schema report error. Locate and fix the cause of the error A list of errors, causes and solutions is here. Validate the fix in Google Search Console Once you have fixed the video output, please use Google』s Structured Data Testing tool to confirm that the video code validates with no errors before using the 『Validate Fix』 button in Google Search Console.

Is the error caused by the Yoast SEO video schema markup?

Before starting, you will need to have at least one URL that is listed in the Google Search Console has having a video error.

Go to Google』s Structured Data Testing Tool.Paste the URL from Google Search Console that has a video error.Click 『Run test』.

On the left side, you will see the underlying source code used to display this specific URL. One the right side, you will see all of the schema markup found for this specific URL.

Yoast SEO and the various add-ons output schema under a single schema section. If you see a standalone 「VideoObject」 item, another plugin or theme is outputting the schema except in cases where your site is using Yoast SEO: Video prior to the 11.0 version.

An Article section is one example where you can find schema output by Yoast SEO: Video.

A stand alone VideoObject section is not output by the current Yoast SEO: Video plugin.

Common errors and solution

Missing field 『thumbnailURL』

Yoast Video SEO outputs this element automatically but it can be customized under the 「Video」 tab of the Yoast metabox.

Missing field 『name』

Yoast Video SEO uses your SEO title to output this element. Make sure you』ve added an SEO title.

Missing field 『description』

Yoast Video SEO uses your meta description to output this element. Make sure you』ve added a meta description.

Missing field 『uploadDate』

Yoast Video SEO pulls this element from the database (upload date or published date for embedded videos).

Other error not listed above

As this report is still new, it is possible that we』ve missed or not seen the error you received. Please contact support for further assistance.

Parse error: Unexpected T_FUNCTION

Parse error: Unexpected T_FUNCTION

The error:

Parse error: syntax error, unexpected T_FUNCTION in/PATH_TO_WORDPRESS/wp-content/plugins/PATH_TO/file.php on line 41

Typically, we see these types of errors when your server is running an older version of php and certain versions of our plugins.

Update PHP to Current Version

You can check the version of php your webhost has installed on your server by adding a phpinfo file as described in this article or by contacting your webhost support team for assistance. If you confirm the server is running a version earlier than php 5.3, upgrading to a current php version will immediately resolve the issue.

Update Plugin to Current Version

As WordPress has a minimum requirement of PHP 5.2, we accidentally used a feature not available in PHP 5.2. This usually is reported and fixed in an update. Please manually update your plugin to the current version to see if the issue goes away. An update guide is available for the free plugins and the premium plugins. If you are running the current version, please report the issue in the appropriate channel.

I haven』t received purchase receipt yet

I haven』t received purchase receipt yet

There are several reasons why you haven』t received your Purchase Receipt shortly after you made a purchase on yoast.com. This article will describe the most common issues. 

PayPal eCheck

When using PayPal, there are a lot of different methods you can use to fund your PayPal account. You can hook up your bank account or credit card, you can transfer money to your PayPal account manually and others. Most of these methods work flawlessly. But there is one (major) exception; PayPal eCheck.

PayPal describes its eCheck service as follows:

An eCheck is an electronic payment funded by the buyer』s bank account. With an eCheck, the recipient should receive the money within 3-6 business days.Source: PayPal

This basically means that the recipient, Yoast when you purchased a product from us, does not receive your payment instantly. In fact, the sellers documentation states it takes 6 – 9 business days.

So if you』ve paid using eCheck less than 10 business days ago, it』s extremely likely we haven』t received your payment yet. Unfortunately we cannot see a detailed status until we』ve received your payment, so please refer to PayPal for updates during this period.

If your payment hasn』t cleared and you haven』t received your purchase receipt after 10 business days, please feel free to contact us about your payment.

Email delivery

Right after we』ve received your (cleared) payment, we send an email to the email address entered during checkout. This email contains important information about your purchase and plugin subscription. Since the email is sent almost instantly, you should usually receive it within a couple of minutes.

If you haven』t, please check your spambox first. Some email programs still do mark our emails as spam. If purchase receipt isn』t there either, there』s two important options to check:

Does your email provider / web host accept email from yoast.com?Have you entered the correct email address?

Unfortunately we can only help you answer the latter one. Just send us an email containing your PayPal confirmation/invoice, your correct email address and the product you bought. Our Support Engineers will be happy to help you solve this problem!