Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Så här fixar du 403 Forbidden Error i WordPress

Har du problem med 403 Forbidden error på din site i WordPress?

403 Forbidden error är ett av de mest irriterande error som en ägare av en WordPress website kan stöta på. Det kan hindra dig från att komma åt ditt WordPress admin area och/eller specifika pages på din website.

I den här artikeln kommer vi att visa dig hur du enkelt fixar 403 Forbidden error i WordPress.

Fixing 403 Forbidden error in WordPress

Vad är 403 Forbidden Error i WordPress?

Felkoden 403 Forbidden visas när behörigheten på din server inte tillåter åtkomst till en viss page på din WordPress website.

Detta error åtföljs vanligtvis av texten:

403 Förbjuden – Du har inte behörighet att komma åt ’/’ på den här servern.

Dessutom uppstod ett 403 Forbidden error när man försökte använda ett ErrorDocument för att hantera requesten.

Här är ett exempel på hur det gillar att se ut:

403 Forbidden status code shown on a WordPress site

Det finns olika scenarier när du kan se detta error. Till exempel:

You may also see ” Access Denied ” instead of the full 403 Forbidden status. Alternativt kan meddelandet lyda: ”Access to yourdomain.com was denied. You don’t have authorisation to view this page.” (Du har inte behörighet att view this page).

Om du vill ha mer information om WordPress-felkoder kan du läsa vår lista över de vanligaste WordPress-felen och hur du fixar dem.

Nu när du känner till de olika typerna av 403 error, låt oss prata om deras orsaker.

Vad orsakar 403 Forbidden Error i WordPress?

403 Forbidden error code visas när din server inte tillåter åtkomst till en viss page. Det finns flera orsaker till att detta kan hända.

En vanlig orsak till error 403 Forbidden i WordPress är dåligt konfigurerade tillägg för säkerhet. Många WordPress säkerhetstillägg kan blockera en IP-adress (eller ett helt intervall av IP-adresser) om de tror att de är skadliga.

En annan möjlig orsak kan vara en skadad .htaccess-fil eller felaktiga behörigheter på din server.

Ditt WordPress webbhotell kan ibland göra oavsiktliga ändringar i inställningarna för servern. Detta kan leda till ett 403 Forbidden error på din site.

Med detta sagt, låt oss ta en titt på hur man fixar 403 forbidden error i WordPress.

Note : Innan du gör något rekommenderar vi att du skapar en komplett backup av din website i WordPress. You can check out our guide on how to back up your WordPress site.

Om du använder ett plugin för automatisk backup av WordPress, se till att du har tillgång till den senaste backupen innan du går vidare.

Du kan använda dessa links om du vill hoppa till en viss metod:

Video Tutorial

Subscribe to WPBeginner

Om du föredrar skriftliga instruktioner är det bara att fortsätta läsa.

Metod 1: Deactivate dina tillägg tillfälligt

Det första du behöver göra är att se om något av dina tillägg till WordPress orsakar 403 forbidden error. För att göra detta måste du tillfälligt deactivate alla WordPress tillägg. Detta inkluderar alla säkerhetstillägg som du kan ha installerat på din webbplats.

Bulk deactivate all WordPress plugins

Om detta löser ditt problem betyder det att ett av tilläggen på din website orsakade detta error.

Du kan ta reda på vilket plugin som orsakade error genom att aktivera alla dina tillägg ett i taget tills du reproducerar 403 Forbidden-felet. Då måste du ta bort det problematiska tillägget och leta efter ett alternativ eller kontakta utvecklarna för support.

Om den här metoden inte fungerar är det bara att fortsätta Läsa.

Metod 2: Återskapa din .htaccess-fil

Ofta orsakas 403 forbidden error av en korrupt .htaccess-fil på din WordPress site. Den goda nyheten är att det är ganska enkelt att fixa den här filen.

Först måste du ansluta till din website med hjälp av en FTP-klient som gillar FileZilla eller File Manager appen i cPanel.

Därefter hittar du .htaccess-filen i rotmappen på din WordPress site. Se denna guide om du inte kan hitta .htaccess-filen i din WordPress folder.

You will need to download the .htaccess file to your computer so that you have a fresh backup of it. Därefter tar du helt enkelt bort filen från din server. Oroa dig inte, din WordPress kommer fortfarande att fungera.

Delete .htaccess file from your WordPress site

Försök nu att komma åt din website. If the 403 forbidden error is resolved, then this means that your .htaccess file was corrupt.

Du kan generera en ny .htaccess-fil genom att logga in på din WordPress admin area och gå till Settings ” Permalinks page.

Regenerating .htaccess file in WordPress

Klicka bara på knappen ”Save Changes” längst ner på sidan, så genererar WordPress en new .htaccess-fil.

Metod 3: Korrekt dina filbehörigheter

Om de andra lösningarna inte har fixat 403 forbidden error på din site, är felaktiga filbehörigheter den mest troliga orsaken.

Alla filer som lagras på din website har filbehörigheter. Dessa filbehörigheter kontrollerar vem som kan komma åt filerna och mapparna på din WordPress website.

Felaktiga filbehörigheter kan orsaka error 403 forbidden. De får din web server att tro att du ej har behörighet att komma åt dessa filer.

Du kan be din WordPress hosting provider att kontrollera din website för korrekt filbehörigheter. Vissa servrar är mycket stödjande, så de kommer inte att ha något emot det och kommer förmodligen att fixa det åt you.

Att själv ändra behörigheter för filer kan få allvarliga konsekvenser. Om du ej känner dig säker på att göra det själv är det bäst att be en annan WordPress website-ägare om hjälp eller anlita ett proffs.

Men om du vill göra det själv, så här kontrollerar du dina filbehörigheter.

Anslut till din WordPress site med hjälp av en FTP-klient. Navigera till rotmappen som innehåller alla dina WordPress-filer.

Checking file permissions

Klicka för att välja en folder, högerklicka på den och välj sedan ”File permissions” i menyn.

Din FTP-klient kommer att visa dig en dialogbox för filbehörigheter som gillar det här:

Changing file permissions using FTP

Alla foldrar på din WordPress site bör ha en filbehörighet på 744 eller 755.

Samtidigt bör alla filer på din WordPress site ha en filbehörighet på 644 eller 640.

Du kan ställa in filbehörigheten för rotmappen till 744 eller 755. Du måste också markera boxen bredvid ”Recursion into subdirectories” och sedan kontrollera alternativet som säger ”apply to directories only”.

Klicka bara på knappen ”OK”. Din FTP-klient kommer nu att börja ange behörigheter för alla subdirectories i den mappen.

När det är gjort måste du upprepa processen för alla filer. Den här gången använder du filbehörighet 644 eller 640, och glöm inte att välja alternativen ”Recursion into subdirectories” och ”Tillämpa to files only”.

Click on the ”OK” button, and your FTP client will start setting file permissions for all the selected files.

Försök att komma åt din website nu och se om 403 forbidden error har försvunnit.

Metod 4: Clear din cache och cookies

Ibland kan en enkel fix vara den mest effektiva. Att cleara din webbläsares cache och cookies, samt din WordPress-cache om du använder ett plugin för caching, kan lösa 403 forbidden error.

Likes how your computer stores temporary files to speed up loading times, your browser also caches website data. Om dessa data blir korrupta kan det orsaka kompatibilitetsproblem och lead till 403 error.

På samma sätt kan en skadad cache som genereras av ett tillägg också leda till att servern misstolkar requests.

Vissa tillägg för caching erbjuder också avancerade inställningar som allowar dig att begränsa åtkomsten till specifika pages eller roller hos användare. Om dessa Settings oavsiktligt är felkonfigurerade kan de oavsiktligt blockera åtkomsten till vissa delar av din website.

För att rensa webbläsarens cache kan du följa instruktionerna i vår artikel om hur du rensar cache i större webbläsare.

Om du använder ett plugin för WordPress-caching kan du läsa vår guide om hur du clearar WordPress-cache och konsultera pluginets dokumentation.

Metod 5: Inaktivera CDN (Content Delivery Network) tillfälligt

Om du använder ett CDN (Content Delivery Network) för att förbättra webbplatsens prestanda är det möjligt att det kan störa och orsaka 403 forbidden error.

Ett CDN fungerar som en mellanhand mellan din websites server och besökarna och serverar cachelagrat content från geografiskt spridda locations för snabbare hämtartider.

För att se om det är ditt CDN som är boven i dramat kan du inaktivera ditt CDN tillfälligt. Testa sedan din website för att se om error försvinner.

Om det inte går att lösa error genom att inaktivera CDN måste du kontakta CDN providerns support team för vidare troublesökning.

Metod 6: Kontrollera om det finns skadlig kod

Skadlig programvara kan orsaka en mängd olika issues, bland annat error 403 forbidden. Det kan störa filernas behörighet, injicera skadlig kod eller störa kommunikationen mellan din website och server.

För att se om det finns skadlig kod på din webbplats rekommenderar vi att du skannar din website med ett säkerhetstillägg eller en tjänst som erbjuds av din WordPress hosting provider.

Många välrenommerade tillägg erbjuder funktioner för att söka efter skad lig kod, och du kan vanligtvis ta bort dessa skadliga filer med ett click.

Learn More sätt att lösa vanliga error i WordPress

Har du andra problem med WordPress? Kanske kan någon av dessa guider hjälpa dig att lösa problemet:

Vi hoppas att den här artikeln hjälpte dig att fixa 403 forbidden error i WordPress. Du kanske också vill se vår lista över de vanligaste problemen med Block Editor och WordPress tillägg som du måste ha för att få din website att växa.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Avslöjande: Vårt innehåll stöds av våra läsare. Det innebär att om du klickar på några av våra länkar, kan vi tjäna en provision. Se hur WPBeginner finansieras, varför det är viktigt, och hur du kan stödja oss. Här är vår editoriala process.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Den ultimata WordPress-verktygslådan

Få GRATIS tillgång till vår verktygslåda - en samling WordPress-relaterade produkter och resurser som varje professionell användare bör ha!

Reader Interactions

163 kommentarerLämna ett svar

  1. Syed Balkhi

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Gary Parker

    None of these fix my problem as it is one page and the only way i could fix it was to rename the permalink, The page in trouble is https://example.com/blog/ and the only way i could fix it was to change it to /blog2/, any ideas?

  3. Michael

    Please somebody help me. I have two websites on the same host. I just added a third addon domain recently and installed wordpress to it through the softaculous installer.

    The problem is not from wordpress, and other websites on the same host is accessible.

    Please help.

  4. Andreas Johansson

    I hade one page Forbiden 403 and tryied all the steps. And now i dont have permission to login wp-admin on my site? :-(

  5. Marcus

    It worked like magic

  6. Juliet Julius

    Thank you so much for this article. My problem was a corrupted htaccess file. My website is now working fine.

  7. Aleli Sanchez Mendez

    I still having this problem. I tried all the steps. The problem began when I installed the WooCommerce plugin in my Wordpress Site. Now in my wordpress y receive a 403 Forbidden and in my other site, without wordpress i recieived a 502 Bad Gateway error.

    Please someone can help me?

  8. Scott Munson

    I discovered – after all else failed and many hours spent, that at one time (but no longer) I used Bullet Proof security. It left a stray .htaccess file in my wp-admin folder – THAT, was causing the 403 error for me. ARGH!

  9. joshua jenish zibhu

    how i solve this probkem…. in windows 10……

  10. john

    Thank you, it worked for me.

  11. Oluwaseun

    Thanks!
    changing file permission works for me.

  12. Yogesh

    Thanks a ton. Deleting .htaccess worked for me.

  13. JU

    There has to be a fourth step. None of these steps applied. The plugins weren’t the cause. The .htaccess file wasn’t the cause. All the permissions in all files and folders are set to the correct numerical values. :(

  14. Sendhil Kumar S K

    Hi Friends, One Easy step will make You free from the existing problem.

    1. Go to CPanel of Your Domain

    2. Click to Expand public_html folder present at the extreme left of the screen.

    3. Double click on wp folder present on the write side of the screen

    4. Copy All files & Folders inside the wp folder

    5. Move all the files & folders inside the wp folder to UP ONE LEVEL

    6. Now All files & Folders are out of WP folder, hence WP folder is empty, come one level up & delete the empty WP folder

    7. Now go to browser & type your domain_name.com, PERFEFETLY it will be WORKING

    All the Best…if you have doubts regarding this mail me to

    Also if time permits visit my site
    Thank You All

  15. Sergio Casabona

    Hi, there! Thanks for this article!
    I got this error, so I access with my ftp and deleted .htaccess file. I’m now able to access my dashboard. But when I go to settings and save again as you say, the error 403 comes back. What can I do?
    Thank you, guys!

  16. Josh Allen

    What if I had a dedicated server, and its happening to all 43 of my sites…I just did some kind of WHM update on Bluehost, then it happened….Ive been waiting for an hour to talk to bluehost.

    • Ronald

      Josh –

      I had a similar thing happening to me here. ”All of a sudden” none of my sites worked anymore.

      I am hosting the sites on my own MacMini, running OS-X Server. After a night of trouble-shooting, I eventually found out that the root cause was me enabling the FTP server in OS-X Server. In there, I set folder permissions for the website root folder for ”Everyone Else” to ”None” (seemed a bit tricky to give everyone Read access to my sites!). Apparently one is also blocking the _www user access to the websites then…

      After I changed this back to ”Read Only”, my sites started working again… Pffff.

      I’m now looking for a permanent solution, which is not: ”Close my firewall for FTP traffic.

      Hope this helps,
      Ronald

  17. Krishna Patel

    This post saved my life! I can’t thank you enough for this helpful information but.. thanks a million :)

  18. shah faisal

    You don’t have permission to access /loading.php on this server.
    Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request

  19. James

    The file permission option fixed it, thanks a lot.

  20. gab

    I am getting the 403 error for my page and cannot even login into WordPress because of it… I don’t know how to fix it and don’t see anyone with the same issue.

  21. Reshan

    Hi. My Wordpress is handled by the hosting company itself. So I dont have root access. How can I solve this problem?

    • WPBeginner Support

      Hi Reshan,

      Please contact your hosting company. They will be able to fix it for you.

      Administratör

  22. Prince

    Thank you. You helped me solved my problem.

  23. Rafael Hernandez-Padilla

    Thank you, the article resolved the issue I was having on my site.

  24. Yves

    Same problem here, and ftp same result… checked in Cpanel and noticed my maindir permissions was 0000 , changed to 0755 and was fixed

  25. Mimi

    In my case, I had my website for 4 years and all of a sudden today I got this error although I did not touch the files or change any permissions. I logged into the control panel and noticed that for some reason the index.php file was missing from the Wordpress root folder. I downloaded a new copy of Wordpress and copied the index.php file on to the root folder of my Wordpress website and the website came back!
    So perhaps if anyone is getting the same error, please double check that you have an index.php or index.html file. I hope that helps.

    • Cian

      Lifesaver – thank you! This worked for me also.

    • justin

      Ditto…no idea why/how but the index.php disappeared while I was working on a project…I was saved a load of hassle by an automatic backup where the index still existed.

    • Nick

      Thanks Mimi! This worked for me while the solutions in the article didn’t. In my case, the index.php file wasn’t actually missing but when I replaced the one that was there with a fresh one the site started working again so I guess it was corrupted or had some kind of other problem.

      My specific error message did also mention the index.php file so that also makes sense:

      Forbidden
      You don’t have permission to access /index.php on this server.

      Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

  26. AMar pal

    Help me my website is down.I tried all the given solutions but nothing worked…

    • Edgar

      Nothing worked for me until I added ”Options +FollowSymLinks” (without the quotes) above ”RewriteEngine On”.

  27. Doni

    I did all three possible causing 403 error fixing that you informed but it still produced the error. By the way i wanted to edit footer template but when i saved / updated file it produced ”403 Forbidden Access to this resource on the server is denied!”

    • Mimi

      This is a reply to your comment on wpbegginer.com (comment quoted below)
      I am not sure if you were able to resolve your problem but I would like to let you know that I got the same error today and I found that the problem was a missing index.php file from the root folder of my website.

      ———————————————————————–
      ”I did all three possible causing 403 error fixing that you informed but it still produced the error. By the way i wanted to edit footer template but when i saved / updated file it produced “403 Forbidden Access to this resource on the server is denied!””

  28. Alexandra

    Hello,

    I need help, while trying install wordpress with mamp, after i did everything what i supposed to do, it showed me this error :
    ’Forbidden

    You don’t have permission to access /mysite on this server.
    Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.’

    Please help me!

  29. Vasil

    Hello guys.

    Forbidden

    You don’t have permission to access /shop/ on this server.

    I’ve tried everything and doesn’t work.
    if someone can help would be great thank you.

  30. KimD

    Thanks. Great article. To fix my problem I had to do a slight variant on what was written. When I looked I found that I had two htaccess files, one in the root directory and another in the wp-admin directory. I regained access to my site by renaming the htaccess file in the wp-admin directory.

    • Alex

      So glad you posted this, this was my exact issue! Thanks!

  31. Kingsley Felix

    Hello;

    Mine happens when i want to save changes of an article by a deleted admin user

  32. Steve

    I have a user who is getting the following 403 when he tries to leave a comment:

    403 Forbidden Error Page

    If you arrived here due to a search or clicking on a link click your Browser’s back button to return to the previous page. Thank you.

    IP Address: xxx.xx.xx.xx” (his actual IP address shows up here)

    What could be wrong?

  33. David

    my problem is in .htaccess File. the passage saves my site. Thanks so much

  34. Omotayo Adeoye

    Hi,
    I get a ’Forbidden’ on the wp-admin page of my website. It doesn’t say error 403 – forbidden; it just says forbidden”.

    I have re-installed wordpress, checked file permissions, checked htpaccess, deactivated all plugins etc. yet it doesn’t work.

    Pls what can i do!

    Thanks a lot.

  35. Ricardo

    Hi! When I share my website link to facebook, the title is 403 Forbidden. Directly on my website I didn’t saw any kind of 403 forbidden message. I tried a lot of advises I found, as removing .htaccess file, desactivating all the plugins and also checked permissions. I tried to debug at facebook debugger, but the informations doesn’t change. Anyone can help me to fix this problem?

    • Mukesh Sharma

      Hello Ricardo,

      send me your website link. I can help.

  36. Harney Cercado

    Awesome! You’re a life saver!
    Thanks!

  37. Shane

    This was very helpful, thank you guys very much , as we say in Jamaica ”Respect”

  38. Javier Gomez

    I have many errors 403 with my images, I will take your advice thanks for the information

    An apology for my bad english

  39. Christopher Sowerby

    Hi. my problem is that i can logout from the backend dashboard but i cant logout from the front end (using the bar at the top).

    It seems that the nonce in the logout url is different when on the backend. Do you know why this could be? i have cleared everything out of my functions.php but it still happens.

  40. Rameez Ramzan

    Hi,

    I am newbie in WordPress and Currently I am facing some problem while login WordPress Dashboard.
    It’s showing 403 forbidden errors while login but on the other side my friend open similar site on their internet then its working correctly. Kindly let me know

    Thanks,

  41. Pascal

    Thank you for this great post! I resolved my 403 error!!! :D

    • WPBeginner Support

      Hey Pascal, glad you found it helpful :) Don’t forget to join us on Twitter for more WordPress tips and tutorials.

      Administratör

  42. Erik Kubica

    I have similar issue, as a company on our dev server we are running much wordpress sites where to only 1 WP site i started to get 403 and only on wp-admin. 2 Days before i have lived elsewhere when it worked.

    foo.bar/somewebsite/* -> 200 OK
    foo.bar/somewebsite/wp-admin -> rediret to wp-login.php -> 403 err

    foo.bar/somewebsite2/* -> 200 OK
    foo.bar/somewebsite2/wp-admin -> rediret -> 200 OK

    Ftp to foo.bar is ok, ssh to foo.bar is ok.

    On ”somewebsite” the WP admin is blocked only for me (all browsers, all existing incognito modes, all cache cleared incl. cookies….). For all people i have asked to try it worked without any problems.

    There is nothing wrong with htaccess, wordfence was disabled from ftp (also checked the DB if there is any ban to my IP). checked the main apache2 access log over ssh where i see the 403 record.

    Any idea what can be wrong?

  43. Vinish Chaudhary

    Forbidden

    You don’t have permission to access / on this server.

    Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

    and none of above method work on this error my cpanel not showing. I read the whole article
    plz, help me solve this.
    thanks

  44. Dewlance

    Uhh! Wordpress wp-admin 403 error is really time killing.

    I try your all tricks but still getting a error. Going to change wp-admin folder with fresh files of wp-admin files.

    Maybe it will help me or other option is apache configuration or poorly mod_security configuration.

  45. Greg

    We work with WordPress everyday and recently encountered the 403 error. It was the file permissions and htaccess file that was reconfigured due to one of the security plugins. Your post on the matter was very helpful. Thanks for taking the time to post it.

  46. zulfiqar ali

    dear sir my site name is my site give me error like

    Forbidden

    You don’t have permission to access / on this server.

    Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

    and non of above method work on this error my cpane not showing any files in file explorer and also not connecting via FTP client.. i read whole article
    plz help me solve this..
    thanks

  47. Lindani

    I cant my thinks now because of this forbidden error help please

  48. hardik

    Hi i really impress with your suggestion thanks u so much i have solve my error

  49. Oliver

    Hi, we have also been experiencing a 403 error. It first started happening when I tried to update the wp-core to 4.5. Ever since we get a 403 about once a day. I have done everything that I can think of to rectify the issue; reverted to a back-up of the site previous to the update; deactivated all plugins; checked file permissions; contacted hosts to see if our IP addresses were blacklisted; deleted .htaccess; changed theme to default 2016 the only thing that works when getting a 403 is to turn off the router wait for the IP to change and then we can access again. So it would seem to be an IP issue but I cannot find where this is IP blockage is.

    Does anybody know of any other place where an IP blacklist maybe?

    Thanks.

  50. Barbara Puchala

    We just had this error. A outside web designer was creating a Wordpress site for us and kept getting the 403 error.
    Turns out our hosting company, as part of its security measures, has its servers block any attempt to sign in with the user name ’Admin’. I know, you would think he would know better. A change to the user name was all that was needed.

  51. george

    your typo
    [due to a poorly configured security plugins]
    due to a poorly configured security plugin

Lämna ett svar

Tack för att du väljer att lämna en kommentar. Tänk på att alla kommentarer modereras enligt våra policy för kommentarer, och din e-postadress kommer INTE att publiceras. Vänligen använd INTE nyckelord i namnfältet. Låt oss ha en personlig och meningsfull konversation.