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.
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:
Det finns olika scenarier när du kan se detta error. Till exempel:
- 403 Forbidden – Åtkomst nekad på wp-admin eller WordPress login page.
- 403 Förbjudet – Under installationen av WordPress.
- 403 Forbidden Error – När du besöker en page på din site i WordPress.
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
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.
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.
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.
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.
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:
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:
- Så här hittar och öppnar du error loggar i WordPress (steg för steg)
- Hur man Fixar WordPress Posts Returnerar 404 Error (Steg för Steg)
- Hur man fixar ERR_NAME_NOT_RESOLVED i WordPress (Step-by-Step)
- Så här fixar du ’ERR_SSL_VERSION_OR _CIPHER_MISMATCH’ i WordPress
- Så här fixar du 500 Internal Server Error i WordPress
- Så här fixar du 502 Bad Gateway Error i WordPress
- Så här fixar du 401 error i WordPress (7 lösningar)
- Så här fixar du 413 Request Entity Too Large Error i WordPress
- Så här fixar du 504 Gateway Timeout Error i WordPress
- Vad är 414 Request URI Too Long Error och hur man fixar det
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.
Syed Balkhi says
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!
Jiří Vaněk says
I encountered the same error, and none of the suggested solutions helped. Eventually, I discovered that the problem was with the web hosting provider, who had applied protection using GEO-IP blocking on certain folders and functions. Specifically, it was the administration and XML-RPC. I had to request permission for certain countries since I was using a VPN to access the website. Sometimes, this error can also occur due to the protection implemented by the web service provider. Their reasoning was that this protection helps prevent brute force attacks.
mohadese esmaeeli says
Hello, good day. I appreciate your efforts in creating this content. The presence of a 403 error is often due to permission issues. I have encountered it multiple times, and most of the time, fixing permissions resolves the error. I’ve successfully resolved my site’s 403 error with the help of this guide before.
Hans Dieter says
Thank you very much! Helped a lot.
WPBeginner Support says
You’re welcome, glad to hear our guide was helpful!
Administratör
Kevin says
For my site it ended up being ModSecurity. I eliminated any robots.txt and .htaccess issues. I found the issue when looking at the apache log and then whitelisted the rule. All was fine after that . Took about 4 days to figure it all out.
WPBeginner Support says
Thanks for sharing this for anyone else who runs into the same issue!
Administratör
Mungukende Joshua says
Thanks, my .htaccess file was corrupted. God bless u
WPBeginner Support says
Glad to hear our guide could help!
Administratör
iri says
Thanks for this information! It has been very helpful. I had this error in several pages with broken images (I think this happened after buying a larger hosting plan) and it seems the problem was a corrupted .htaccess file, but thanks to this info I solved it in one minute!
WPBeginner Support says
Glad to hear our guide was helpful!
Administratör
Ayouba Seybou says
Hello,
i am getting the same error but in my case, i have access to my dashboard. the the problems begin when i click on some admin menu like page, update, setting.
WPBeginner Support says
Our recommendations would be the same even if you still have access to your wp-admin area.
Administratör
Wendy Clash says
Thank you so much. I had to restore my website and I got this error. The entire folder for my wordpress site dit not have the right permissions. I changed it and it worked. Thanks so much.
WPBeginner Support says
Glad to hear our guide was helpful!
Administratör
Denie says
You may also try to disable MODSECURITY on your webserver settings / cpanel.
WPBeginner Support says
Thank you for sharing that, if it gets to the point where disabling mod security is what you want to try, we would recommend most beginners reach out to their hosting provider instead to see if their host sees an error or something on their end that could be fixed.
Administratör
Peaky says
Hey thanks for this Guide
Saves me from a long headache
Nb : Deactivate Litespeed Cache fix my problem
WPBeginner Support says
Glad this guide could help!
Administratör
meysam says
thanks, delete .htaccess is worked for me.
WPBeginner Support says
Glad our guide could help
Administratör
Anmol Gupta says
The same error can occur when index.php file can be missing in the var/html folder.
Sazid says
Thanks. Deleting .htcacess file worked for me.
salah attalhi says
thanks mate, this worked with me, deleting .htaccess
WPBeginner Support says
Glad our guide was helpful
Administratör
Jason Gomes says
I am getting 403 Error on Updates page as well as Plugins Add new page any suggestions what can I Do?
WPBeginner Support says
Reach out to your hosting provider for them to take a look and they should be able to help fix that issue.
Administratör
Suraj says
I tried all the mentioned points. My site is still showing the same message as ””Your connection is not private” and ”403 Forbidden”. Please help…
WPBeginner Support says
If none of our recommendations are able to assist you, we would recommend reaching out to your hosting provider to ensure there are no issues on their end.
Administratör
Luke says
top!! i have problem after namecheap upgrade my host!! with your article i solve!! Thanks
WPBeginner Support says
Glad our guide helped
Administratör
David Holywood says
THere MUST be more reasons. I still have the ’Forbidden’ problem
WPBeginner Support says
There can be or sometimes the host may prevent the file permissions from being changed. If our guide did not help we would recommend reaching out to your hosting provider and they should be able to assist.
Administratör
ken says
Thank you, renaming htacces file fixed it
WPBeginner Support says
Glad our guide could help
Administratör
Aditya PF says
Hi, how to solve the 403 forbidden but only happens when try to publish or update post/pages? I have no problems when accessing website or upload media
WPBeginner Support says
Reach out to your hosting provider for them to take a look and they should be able to assist and fix that issue.
Administratör
Amer Huzaifa says
thanks so much u helped me so much with this issue
WPBeginner Support says
Glad our guide was helpful
Administratör
momna says
The plugin thing worked for me. Thank you thank you so much <3
WPBeginner Support says
You’re welcome
Administratör
Poncho says
Thanks, erasing htaccess resolve my issue. Because sometimes appears 403, not always.
WPBeginner Support says
Glad our recommendations were able to help
Administratör
Joel says
Removing from the .htaccess file fixed this error for me.
WPBeginner Support says
Glad you were able to solve the issue
Administratör
Mohd Anwar says
I have done all the thing read in this article yet the problem persist is there any other solution?
WPBeginner Support says
If none of these recommendations helped, we would recommend reaching out to your hosting provider and they can normally assist
Administratör
Alan Wright says
Followed up all tips, thank you. The htaccess one was closest: after removing the image Hotlinks rule within, my site is finally back to normal!
WPBeginner Support says
Glad our guide could be helpful
Administratör
Alabi says
I never knw .htaccess get corrupt. Tip number 2 fixed it quickly but I was unable to generate the .htaccess. So I downloaded, delete and re-upload the .htaccess and it worked super fine. Thank you, WPBeg
WPBeginner Support says
glad our recommendations could help
Administratör
Itumeleng Masinamela says
Thank you so much for this. Really helped
WPBeginner Support says
You’re welcome, glad our guide was helpful
Administratör
Humayan Kabir says
Hi,
Suddenly my website is showing a message ”This site can’t be reached” .Can anybody help me ? i am unable to fix it for last 7days.
Thanks,
WPBeginner Support says
Have you reached out to your hosting provider? They can normally let you know any errors they can find on your site.
Administratör
Inge says
Thank you so much for sharing!! Finally able to fix it myself
WPBeginner Support says
You’re welcome, glad our article could help
Administratör
Essau says
I’m glad I read the post and tried everything mentioned here but it did not work. However, the user comments were resourceful. I tried step by step all the suggestions people have mentioned and I found that MOD SECURITY, just as others have mentioned, is the main culprit.
Since I’ running a VPS, I disabled it from my control panel and did the adjustments I wanted on my site and it worked like a charm!.
WPBeginner Support says
Glad the recommendations from our other readers was able to help
Administratör
jake says
Bingo! MOD SECURITY same issue here.
Basit Yousuf says
Thanks Dear,
MODSECURITY is a real culprit. I have fixed mine as well. Thanks for tip. Cheers!
N. iru says
After I installed wordpress. My webpage is still on 403 error and when I go to /wp-admin a 404 error appears. Basically wp-admin is missing. How should I fix this?
WPBeginner Support says
You may need to check with your hosting provider with the 404 error for wp-admin but some steps you could try we cover in our article here: https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Administratör
Adam says
Hi,
My images don’t appear at all when I view my site on different web browsers.
What could be causing this?
cheers
WPBeginner Support says
It’s difficult to say the one specific reason but for a starting point you could go through our troubleshooting guide here: https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Administratör
Nukri Tusishvili says
I have tried all the things, checked stackoverflow, google, than tried these paths and none of them work. The last thing i did i reinstalled wordpress from dashboard and it worked. 403 forbidden disappeared…
Thank you anyway for this article. hope my exp will help others also
WPBeginner Support says
Thanks for sharing what solved the issue for you.
Administratör
Loulou says
Thank you so much for your helpful tips! It was my .htaccess file.
WPBeginner Support says
Glad our recommendations could help
Administratör
Jovan says
For me Yoast plugin was making problem. I`ll try to reinstall it and see whats happens next.
WPBeginner Support says
Should the problem continue with yoast, if you reach out to the plugin’s support they may be able to update and fix the problem
Administratör
@bangsaid says
Thanks so much
It works for me
WPBeginner Support says
You’re welcome, glad it worked for you
Administratör
Abhishek Goyal says
Thanks a lot, changing permissions of the folder worked for me.
WPBeginner Support says
Glad our recommendations helped and thanks for sharing what worked for you
Administratör
Rick says
How do you fix an RSS 403 error in WordPress??
WPBeginner Support says
The methods in this article should also work for fixing your RSS
Administratör
David Kempton says
File uploads with illegal characters (e.g. apostrophe in my recent cases) cause a 403 error. I have seen this with file submissions in Gravity and WPForms.
WPBeginner Support says
Thanks for sharing this additional possibility
Administratör
Jan says
I have started a new website for an individual through WP. When old website is pulled up, it gives a ”Forbidden- access denied on this server”. I have tried many things through WP to fix the problem, but since it was that way before, would it be something from the last webhost? I have changed the nameservers on the domain site to the new host site I’m using. The new host has it as primary domain, but says domain is locked. Would unlocking the domain name make a difference? Any help would be MUCH APPRECIATED!!
WPBeginner Support says
If the domain is locked then your old hosting provider normally may not be accepting the nameserver edits. If you reach out to where the domain is currently hosted they should be able to ensure the domain is pointing correctly.
Administratör
Frannie says
Thank you!
Goodbye .htaccess… Hello website!
WPBeginner Support says
Glad our article could help
Administratör
Stephanie says
”Failed to load resource: the server responded with a status of 403 (Forbidden) async-upload.php:1” is the console error log I am seeing when I try to upload an image to media in the dashboard. It says ”http error” when I try upload any files. And they’re only a few kb, also the upload size has been increased already.
Any suggestions?!
WPBeginner Support says
For that specific error you would want to take a look at our guide here: https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-http-image-upload-error-in-wordpress/
Administratör
Ramesh says
I have tried all the things but still not getting a solution. What is should do?
WPBeginner Support says
Reach out to your hosting provider and let them know about the issue and they should be able to assist
Administratör
liam says
Hiya Folks, I worked through everything and nothing seemed to fix my problem then I had a spark of genius. If you use Cpanel then check under the Security option for Hotlink protect. You may have it turned on. Just add your full site website web address to it and click submit it should work. It did for me
WPBeginner Support says
Thanks for sharing what solved it for you
Administratör
Luthfunnahar Hussain says
why i am getting this problem –
Failed to load resource: the server responded with a status of 403 (Forbidden)
wp-content/themes/health/assets/slabText/css/slabtext.css?ver=5.0.3
WPBeginner Support says
You would want to take a look at step 3 in the article for an error like that with your theme
Administratör
David says
Thanks, that really helped me!
Wellington Lübke says
Works for me after i disabled ModSecurity on Cpanel. If you don’t have access to this option, contact your host provider and say that you want to disable this option.
Hope that works for y’all!
Gabriel says
Thanks brother, I couldn’t solve the problem, your answer helped me.
twinkle says
Hi, Please help.. I got this error when i tried to log in my wp-admin ..
HTTP Error 403 – Forbidden
The Web server is configured to not list the contents of this directory or you do not have enough permissions to access the resource
Error. Page cannot be displayed. Please contact your service provider for more details. (14)
Thanks in advance
asim says
When i was putting my second addon doamin i select blog in directory (optional). I think it should be empty now i can’t see my website when i enter sitename .com its says error. i can access my wp admin as sitename .com/blog/wp-admin. i want to remove blog from it. My first website on this hosting is working fine with wordpress, Godaddy. I don’t know what to do please some one help me???