Wordpress 403 Forbidden Error

12,568

Solution 1

I'm a regular WP developer, and I see little bugs like this all the time. Unfortunately, it usually means it's time to go through the tedious work of testing. The problem likely lies either with Apache/htaccess, or in a WP plugin or Theme.

To attempt to eliminate WP as the cause of this specific issue, I'd try creating a php file with the following in it:

<?
if (isset($_POST["field"]))
    echo $_POST["field"];
?>
<form method='post'>
    <input type='hidden' name='field' value='<a href="http://hotfile.com/dl/">TEST</a>'>
    <input type='submit' value='Test'>
</form>

If clicking "Test" does not result in the same 403 error, then it's something happening with WP specifically. If it does result in a 403, then it's a much more annoying problem that you are going to want to take up with your hosting provider.

If it is a WP problem, the first thing I would do is to start deactivating plugins 1 by 1, starting with the plugins I think are the most likely culprits. If I have no reason to suspect one over another, I just disabled them all, 1 at a time. Once a plugin is disabled, I try to recreate the original issue. If the problem still happens, it's obvious that plugin wasn't at fault, and I reactivate it and test the next one. 9 times out of 10, my issue is found this way. Be careful when trying this, as some plugins will clear their settings when they're deactivated.

If that doesn't solve the issue, I'll try a different theme and see if that fixes it. Obviously if the problem is gone when you try a new theme, you know where your problem is. Again, some themes can have setting associated with them, and changing the theme can lose those settings.

Finally, check your wp-content/mu-plugins folder for plugins that are always active and don't always show up in your list of plugins.

Solution 2

I realize this post is as ancient as time itself but I've run into a similar problem took me forever to figure out what was going on until i realized all I had to do is add:

Options +FollowSymLinks

At the top of the .htaccess file and presto! It worked.

Options +FollowSymLinks
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Credit goes to this good man: http://www.coolestguyplanettech.com/403-forbidden-error-wordpress-htaccess/

Solution 3

I also had a similar issue, apparently wordpress has some problems with some bits of code I tried to add in my post. I managed to bypass the issue by surrounding the code in <pre> tags.

Share:
12,568
wiredmark
Author by

wiredmark

My name is Marcello and I am a computer science enthusiastic. Also, I am an order and cleanliness maniac, hardcore coffee drinker, videogames frequent dropper and terminal anxious who never stops in front of the trials of life.

Updated on June 04, 2022

Comments

  • wiredmark
    wiredmark almost 2 years

    I am having a CRAZY error with Wordpress. When I create a new article or edit an old one, I cannot insert hotfile links that go after the first trailing slash.

    I'm explaining it better. If in a post I do:

    <a href="http://www.hotfile.com">TEST</a>
    

    I can correctly create the article. If I do:

    <a href="http://www.hotfile.com/">TEST</a>
    

    Or longer link, like:

    <a href="http://www.hotfile.com/dl/[...]">TEST</a>
    

    I get an instant 403 error when updating the post from administration. This is crazy, and happens only with Hotfile links. Everything else works like a charm.

    What could the error be? If it helps, i'm posting my .htaccess, that I never changed from my WP installation:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    

    Already done repairing and optimization of MySQL DB. Kind thanks in advance to everyone.