API Fetch Errors

#425404
Viewing 15 replies - 1 through 15 (of 23 total)
  • Anas
    Rank Math business

    Hello,

    Thank you for contacting Rank Math, and sorry for any inconvenience caused.

    Can you please reinstall the Rank Math plugin and see if the issue is resolved?

    You won’t lose any existing settings as the settings are saved in the database.

    If the issue persists, please take a backup of your .htaccess file and replace it with the default WordPress .htaccess file. You can get the file here: https://wordpress.org/support/article/htaccess/

    You can follow this guide to edit the .htaccess file:
    https://rankmath.com/kb/edit-htaccess/

    Let us know if the issue persists.

    We are here to assist you.

    I use a few plugins that modify the .htaccess file so I don’t know if that’s going to fly.

    In terms of reinstalling RankMath, do I have to uninstall it and reinstall from there or is there a ‘reinstall’ function now incorporated into RankMath?

    Anas
    Rank Math business

    Hello,

    You need to uninstall and reinstall from the plugins page in WordPress.

    Let us know how it goes.

    We look forward to helping you.

    Just uninstalled RankMath, blew out the server cache and cloudflare cache and reinstalled RankMath from scratch. Had to reconnect Analytics and GSC. Still the same issue. Same error because it’s calling to that directory that doesn’t exist on the server.

    Hello,

    We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    This is a client site so providing admin credentials is not optimal. Right now, just by inspecting the code, it’s apparent that the site is calling for a file that doesn’t exist in a directory that doesn’t exist (wp-json). Have you ever seen this before?

    After doing some research, it seems that wp-json is very much tied to the WordPress REST-API (https://wordpress.org/support/topic/where-is-wp-json/). While much of this discussion was over my head, the one thing that made me think is that I have the REST-API restricted for security purposes.

    Let me ask you, does RankMath use the REST-API at all? If it does, this may be why it’s trying to hit that directory and nothing is there because RankMath has not been allowed to write to it.

    Hello,

    The issue is not happening on our end, even with the latest version installed.

    In this case, could you confirm if you’re using a firewall? If yes, please whitelist the routes mentioned in this guide and see if that fixes the issue: https://rankmath.com/kb/meta-data-not-saving/#firewall

    Also, please head over to your WP Dashboard > Rank Math > Status & Tools > System Status and click the Copy System Info to Clipboard, and paste it here so we can further analyze the issue.

    Looking forward to hearing back from you.

    Thank you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    OK, so I’ve copied the System Info and put it in the Sensitive Data field for your review.

    I’ve checked out the article you shared (thank you BTW). I currently run 3 firewalls: Cloudflare, Malcare, and cpHulk (on our servers). Is there a set of IP addresses we need to whitelist to make sure RankMath doesn’t encounter any difficulties?

    Also, I’m not seeing any directory on the FTP with the name “wp-json”. Any thoughts on that?

    Nigel
    Rank Math business

    Hello,

    Thank you for your patience as we look into why Rank Math is giving REST API errors on your website, and for the details you shared in the sensitive data area.

    Is there a set of IP addresses we need to whitelist to make sure RankMath doesn’t encounter any difficulties?

    Please whitelist the following REST routes on each of your firewalls. You can contact support :

    
    /wp-json/rankmath/v1/updateMeta
    /wp-json/rankmath/v1/updateSchemas
    /wp-json/rankmath/v1/updateRedirection
    /wp-json/rankmath/v1/getFeaturedImageId
    /wp-json/rankmath/v1/getHead
    

    The following guide shows how to go about whitelisting Rank Math in CloudFlare:https://rankmath.com/kb/meta-data-not-saving/#whitelist-rankmath-cloudflare. Please get assistance from your other firewall plugins for how to exclude the Rank Math files/paths

    Also, I’m not seeing any directory on the FTP with the name “wp-json”. Any thoughts on that?

    REST API files are dynamically generated, so you will not be able to see them in your FTP file structure, however you can test test if REST API is active by visiting the base URLs like the following (replace ‘yoursite.com’ with your domain) :
    https://yoursite.com/wp-json/wp/v2/
    https://yoursite.com/wp-json/rankmath/v1/

    Hope that helps. Please let us know if you have questions.

    Thanks for this. Lots of good info here. So the good news is that I checked those two links and it seems that there are files being generated there – so that’s good.

    In terms of whitelisting these Rankmath REST routes, that sounds great but I’m out of rules. I’m using them for other things. Is there any other way to whitelist these? Am I the only person that has run into this?

    Hello,

    You need to check your current plan as adding more rules may require upgrading. Please check this one with your hosting provider.

    Also, try adding this type of rule to see if this works even without the rest of the API rules:

    /wp-json/rankmath/v1/*

    This will allow you to use a single rule instead of adding a specific route.

    If that doesn’t work, you need to check your plan as I mentioned first.

    Looking forward to helping you.

    So everyone who uses Cloudflare needs to whitelist specific directories through custom rules just to be able to use RankMath? That can’t be. I’ve never had to do this for any other SEO plugin. There has to be a better way. I can’t justify paying for a premium Cloudflare about for every client just to use this plugin.

    Hello,

    If the Cloudflare firewall is blocking access to those routes you need to whitelist them, but only when the status code is returning a 403 for actions that use them.

    The route that you showed is returning a 404 error which is not a permission issue but rather the REST route is missing on the website.

    Please make sure that you save your permalinks and rebuild the index for Analytics by going to WordPress Dashboard > Rank Math > Status & Tools > Database Tools.

    This is to prevent the route to call an undefined post on your website, which is the root cause of the issue.

    Don’t hesitate to get in touch if you have any other questions.

    So there’s no list of IP addresses I can just whitelist for RankMath? We’ve got a significant list of those.

Viewing 15 replies - 1 through 15 (of 23 total)

The ticket ‘API Fetch Errors’ is closed to new replies.