403 Forbidden error

  • Hi there,
    I'm receiving a 403 Forbidden error whenever I try to add code or make any changes to the existing code I've added using the Header and Footer Scripts plugin, when it's via the Settings in WordPress. I hope this makes sense. It won't save any changes and just comes up with a 403 Forbidden error. This is on all of my websites. I only noticed this last week before that it was working fine.

  • Hi,

    Could you share the exact code you are trying to add, so I could try to debug.

  • Hi,
    It doesn't matter what I add, it happens when I try to save changes.

  • OK. I will try to replicate the issue. Have you updated your WordPress or plugins/themes?

  • Yes I do that daily.

  • Hi again, I'm also getting the same error now when I try to add code to the Header via one of the Pages in WordPress. I'm trying to add:
    <meta name="robots" content="noindex">
    It says "Access to this resource on the server is denied!"

  • Hello @RedJanet

    I can't replicate the issue and I am not getting any error message on my site. May be you should try to debug and share the info generated by WordPress.

    Add the following code to your wp-config.php and then try to edit the following script and enable wp_debug.

    define( 'WP_DEBUG', false );

    For more information read: https://codex.wordpress.org/Debugging_in_WordPress

    PS: don't forget to make a backup of your WP.

  • Okay thanks I will try that.

  • Okay, it appears to be the Google Console verification code that is causing the error. The code has been there for 18 months so not sure why it would suddenly cause an error, but it is not just happening on your plugin. I have taken the code out and Google Console appears to still be working and so is your plugin. Thanks for your help.

  • Oops spoke too soon. Looks like I still can't add either of the following lines of code to anything without getting the same error. Is this a problem with Google?
    <meta name="robots" content="noindex">
    <meta name="googlebot" content="noindex">

  • It is certainly not Google. To me it looks like file permission or may be some recent update. Have you made any change to WP files including plugin or themes?

    Try to add simple text like hello world and test if the plugin saves it or check on different page.

  • I haven't made any changes, and it's happening across 3 different hosting accounts. I wonder if it is the WordFence plugin...it was updated a week ago.

  • Are those accounts on different server?

    You may try reinstalling the plugin. Go to Plugins and Deactivate/Delete the plugin and Install it again. Your data will NOT be lost.

  • All on shared hosting with the same provider.
    Okay I've tried deleting WordFence but still getting an error. I also updated permissions on all WP folders and files, and deactivated all plugins and that didn't work either. Removed the .htaccess file too but still get the error.

  • Just to let you know I logged a job with my hosting service and they fixed the problem - they said there was a modsec rule that I was tripping, and they have whitelisted it.

  • OK. Thanks for confining. I hope you are enjoining the plugin. Please rate us and leave a review at WordPress.org, if possible.


Log in to reply