1. Home
  2. Knowledge Base
  3. How to Whitelist Rank Math in Wordfence?

How to Whitelist Rank Math in Wordfence?

Rank Math uses REST API for saving metadata on your website. In case, if you’ve security plugins like Wordfence installed on your website and in an unlikely situation, if Rank Math’s REST routes are being blocked, then you should whitelist Rank Math in Wordfence.

In this knowledgebase tutorial, we’ll walk you through how to whitelist Rank Math in Wordfence.

Enabling Learning Mode in Wordfence

Wordfence Web Application Firewall would look for typical attack patterns on your website’s requests and then blocks them to secure your website. But at times, this could be a false positive, and Wordfence may block a functionality you’re using on your website.

To help Wordfence distinguish suspicious attacks and the functionality of your website, it comes with a feature called Learning Mode.

When you set Wordfence in Learning Mode, Wordfence will start to learn the requests you make on your website during day-to-day tasks, and any suspicious requests during this learning period will be automatically added to the Allowlist.

This could reduce the chances of Wordfence blocking your website’s regular functionalities. To set Wordfence in learning mode,

1 Open Wordfence Firewall Options

At first, head over to Wordfence > Firewall inside your WordPress admin area and then choose the All Firewall Options.

Open Wordfence - All Firewall Options

2 Change Web Application Firewall Status

In the Firewall Options, scroll down to the Basic Firewall Options section. Under the Web Application Firewall Status, choose Learning Mode as shown below.

Choose learning mode in Wordfence

You can also set up a date in the Automatically enable on field. Wordfence will be under Learning Mode until this date, and after that, Wordfence will enable protection.

Automatically enable on Wordfence protection

3 Save Changes

Now click the Save Changes button at the top of the page for the changes to reflect.

Save changes in Wordfence

Whitelisting Rank Math in Wordfence

In case, if you wish to allowlist Rank Math REST routes directly in Wordfence, then you can follow the below steps.

1 Open Wordfence Firewall Options

Head over to the Wordfence Firewall Options under WordPress Dashboard > Wordfence > Firewall > All Firewall Options.

Open Wordfence - All Firewall Options

2 Add Allowlisted URLs

Scroll down to the bottom of the page to find the Allowlisted URLs section. Here you’d need to:

  • Add the Rank Math REST route (shared below) in the URL field
  • Choose the Param type to be Query String
  • Add the Param Name as ?_locale=user
  • Finally, click Add button
Configuring Allowlisted URLs
https://example.com/wp-json/rankmath/v1/updateMeta
https://example.com/wp-json/rankmath/v1/updateSchemas
https://example.com/wp-json/rankmath/v1/updateRedirection

In the above URLs, make sure to replace example.com with your domain name and add all the 3 REST routes. Once you’ve added the REST routes, your Allowlisted URL rules should look like this.

Allowlisted URLs with Rank Math REST routes

3 Save Changes

Next, click the Save Changes button at the top of the page for the changes to be reflected.

Save Changes in Wordfence

And, that’s it! Now check if you’re able to save the metadata with Rank Math. If you’ve followed the above steps and still your Rank Math REST routes are being blocked by Wordfence, then feel free to open a support ticket directly from here, and we’re always here to help.

Still not using Rank Math?

Setup takes less than 5 minutes including the import from your old SEO Plugin!

Know more about the PRO Version

Was this article helpful?

Still need help?

?

Submit Your Question

Please give us the details, our support team will get back to you.

Open Ticket