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

14 viktiga tips för att skydda ditt admin area i WordPress (Updated)

Letar du efter sätt att skydda din WordPress admin area?

Genom att skydda admin area från obehörig åtkomst allow you att blockera många vanliga säkerhetshot. Detta kan vara till hjälp om du ser många attacker på din WordPress website.

I denna tutorial kommer vi att visa dig några av de viktigaste tipsen och hacks för att skydda din WordPress admin area.

Tips and hacks to protect WordPress admin area

Vi kommer att täcka många tips, och du kan använda snabblänkarna under för att hoppa mellan dem:

1. Använd en firewall

En firewall övervakar trafiken på webbplatsen och blockerar misstänkta requests från att nå your website.

Det finns flera tillägg till WordPress firewall, t.ex. Wordfence, men vi rekommenderar att du använder Sucuri. Det är en tjänst för säkerhet och övervakning av webbplatser som erbjuder en molnbaserad firewall för att skydda din website.

Website Application Firewall

All trafik på din website går först genom Sucuris molnproxy, som analyserar varje request och blockerar misstänkta requests från att någonsin nå din website. Detta förhindrar att din website utsätts för hackningsförsök, nätfiske, skadlig kod och andra skadliga aktiviteter.

Ett annat bra alternativ är Cloudflare, vilket är vad vi nu använder på WPBeginner. För mer detaljer, se vår artikel om varför vi bytte från Sucuri till Cloudflare.

2. Skydda WordPress Admin Directory med password

Din WordPress admin area är redan skyddad av din WordPress password. Men genom att add to password protection till din WordPress admin directory lägger du till ytterligare ett lager av säkerhet på din login page.

Först måste du logga in på din WordPress dashboard på webbhotellet cPanel och sedan clicka på ikonen ”Password Protect Directories” eller ”Directory Privacy”.

Directory privacy

Därefter måste du selecta din wp-admin folder, som normalt ligger i /public_html/ directory.

På nästa vy måste du kontrollera boxen bredvid alternativet ”Password protect this directory” och ange ett namn för den skyddade katalogen.

Därefter klickar du på knappen ”Save” för att ställa in behörigheterna.

Password protect directory settings

Därefter måste du trycka på knappen tillbaka och sedan skapa en användare. You will be asked to provide a username/password and then click on the ”Save” button.

När någon nu försöker besöka WordPress admin eller wp-admin directory på din website, kommer de att bli ombedda att enter användarnamn och password.

Enter password

För mer detaljer, se vår guide om hur du skyddar WordPress admin (wp-admin) directory med password.

3. Använd alltid starka password

Always use strong passwords

Använd alltid starka lösenord för alla dina online accounts, inklusive din WordPress site. Vi rekommenderar att du använder en kombination av bokstäver, siffror och specialtecken i dina password. Det gör det svårare för hackare att gissa sig till ditt password.

Vi får ofta frågan från Beginners om hur man kommer ihåg alla dessa password. Det enklaste svaret är att you don’t need to. Det finns några riktigt bra appar för hantering av lösenord som du kan installera på din dator och telefon.

Mer information om detta ämne finns i vår guide om hur du hanterar password på bästa sätt för WordPress nybörjare.

4. Använd tvåstegsverifiering på WordPress login vy

WordPress login screen with Google Authenticator enabled

Tvåstegs-autentisering, även känd som tvåfaktors-autentisering, tvåfaktorsverifiering eller 2FA, add to ytterligare ett säkerhetslager till dina password. Istället för att bara använda lösenordet ber den dig att enter en verifieringskod som genereras av Google Authenticator-appen på din telefon.

Även om någon kan gissa sig till ditt WordPress password, behöver de ändå Google Authenticator-koden för att komma in.

För detaljerade steg-för-steg-instruktioner, se vår guide om hur du ställer in 2-stegsverifiering i WordPress med hjälp av Google Authenticator.

5. Limit Login Försök

Limit login attempts

Som standard tillåter WordPress användare att enter lösenord så många gånger de vill. Det innebär att någon kan fortsätta att försöka gissa ditt WordPress password genom att enter olika kombinationer. Det allow också hackare att använda automatiserade skript för att knäcka password.

För att fixa detta måste du installera och aktivera plugin-programmet Limit Login Attempts Reloaded. Efter aktivering, gå till besök Settings ” Login Lockdown page för att konfigurera plugin-inställningarna.

För detaljerade instruktioner, se vår guide om varför du bör limit login-försök i WordPress. För att lära dig mer om pluginet kan du också kontrollera vår detaljerade Limit Login Attempts review.

6. Limit Login Access till IP-adresser

Ett annat bra sätt att säkra WordPress login är att limitera åtkomsten till specifika IP-adresser. Detta tips är viss användbart om du eller bara några få betrodda användare behöver tillgång till admin area.

Add helt enkelt denna kod till din .htaccess-fil:

AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName "WordPress Admin Access Control"
AuthType Basic
<LIMIT GET>
order deny,allow
deny from all
# whitelist Syed's IP address
allow from xx.xx.xx.xxx
# whitelist David's IP address
allow from xx.xx.xx.xxx
</LIMIT>

Glöm inte att ersätta xx-värdena med din egen IP-adress. Om du använder mer än en IP-adress för att komma åt internet, se till att du addar dem också.

Detaljerade instruktioner finns i vår guide om hur du begränsar åtkomsten till WordPress-admin med hjälp av .htaccess.

7. Inaktivera tips för login

Disabled login hints

Vid ett Misslyckat försök till login visar WordPress error som talar om för användarna om användarnamnet eller passwordet var felaktigt. Dessa login-tips kan användas av någon för skadliga försök som gillar brute force-attacker.

Du kan enkelt dölja dessa tips om login genom att lägga till följande kod i ditt temas functions.php-fil eller genom att använda ett code snippets plugin som WPCode (rekommenderas):

function no_wordpress_errors(){
return 'Something is wrong!';
}
add_filter( 'login_errors', 'no_wordpress_errors' );

För mer detaljer, se vår guide om hur du lägger till custom code i WordPress utan att förstöra din website.

8. Obligatoriskt för användare att använda starka password

Om du run en WordPress site med flera auktoriserade användare, kan dessa användare edit sina användarkonton och använda ett svagt password. Dessa password kan knäckas och ge någon tillgång till WordPress admin area.

För att fixa detta kan du installera och aktivera SolidWP plugin. Sedan kan du följa stegen i vår kompletta guide om hur du tvingar fram starka lösenord för användare i WordPress.

9. Återställ password för alla användare

Är du bekymrad över säkerheten för password på din multi-site WordPress site? Du kan enkelt be alla dina användare att återställa sina password.

Först måste du installera och aktivera plugin för Emergency Password Reset. När du är aktiverad går du till sidan Användare ” Emergency Password Reset och klickar på knappen ”Återställ alla lösenord”.

Reset all passwords

Detaljerade instruktioner finns i vår guide om hur du återställer lösenord för alla användare i WordPress

10. Håll WordPress Updated

WordPress släpper ofta nya programvaruversioner. Varje ny version av WordPress core innehåller viktiga buggfixar, nya funktioner och säkerhetsfixar.

Om du använder en äldre version av WordPress på din site är du öppen för kända exploateringar och potentiella sårbarheter. För att fixa detta måste du se till att du använder den senaste versionen av WordPress.

Mer om ämnet finns i vår guide om varför du alltid bör använda den senaste versionen av WordPress.

På samma sätt uppdateras WordPress tillägg ofta för att införa nya funktioner eller fixa säkerhets- och andra issues. Se till att dina tillägg till WordPress också är uppdaterade.

Note : Föredrar du att lämna ditt WordPress-underhåll till proffsen? Våra WPBeginner underhållstjänster kan ta hand om allt från updating till malware removal så att you bara kan fokusera på att run din website.

11. Skapa customize login- och registreringssidor

Många WordPress-webbplatser kräver att användare registrerar sig. Till exempel membership sites, learning management sites och online stores kräver att användare skapar ett account.

Dessa användare kan dock använda sina konton för att logga in på WordPress admin area. Detta är inte en stor issue, eftersom de bara kommer att kunna göra saker som tillåts av deras användares roll och capability.

Det hindrar dig dock från att på rätt sätt begränsa åtkomsten till login- och registreringssidor, eftersom du behöver dessa pages för att användare ska kunna registrera sig, hantera sina profiler och logga in.

Det enkla sättet att fixa detta är genom att skapa custom login och registrering pages så att användare kan registrera sig och logga in direkt från din website.

För detaljerade Step-by-Step instruktioner, se vår guide om hur du skapar customize login och registrering pages i WordPress.

12. Lär dig mer om roller och behörigheter för WordPress-användare

WordPress har ett kraftfullt system för hantering av användare med olika roller och capabilities. När du lägger till en new användare på din site i WordPress kan du välja en roll för användaren. Denna roll definierar vad användaren kan göra på din site i WordPress.

Genom att tilldela felaktiga roller kan användare få fler capabilities än de behöver. För att undvika detta måste du förstå vilka capabilities som följer med olika roller i WordPress.

Mer information om ämnet finns i vår guide för nybörjare om roller och behörigheter för WordPress-användare.

13. Limitera åtkomst till WordPress dashboard

Vissa WordPress-webbplatser har vissa användare som behöver tillgång till dashboarden och andra användare som inte behöver det. Som standard har dock alla tillgång till admin area.

För att fixa detta måste du installera och aktivera pluginet Remove Dashboard Access. Efter aktivering, gå till Settings ” Dashboard Access page och välj vilka användarroller som ska ha tillgång till admin area på din site.

För mer detaljerade instruktioner, se vår guide om hur du begränsar åtkomst till dashboard i WordPress.

14. Logga ut inaktiva användare

Idle user logout

WordPress loggar inte automatiskt ut användare förrän de uttryckligen loggar ut eller stänger webbläsarens fönster. Detta kan vara ett problem för WordPress webbplatser med känslig information. Det är därför som finansinstitutens webbplatser och appar automatiskt loggar ut användare om de inte har varit aktiva.

För att fixa detta kan du installera och aktivera pluginet Inactive Logout. När du har aktiverat det, gå till Settings ” Inactive Logout page och enter den tid efter vilken du vill att användarna ska loggas ut automatiskt.

För mer detaljer, se vår artikel om hur du automatiskt loggar ut användare som inte är aktiva i WordPress.

Vi hoppas att den här artikeln hjälpte dig att lära dig några new tips och hacks för att skydda ditt WordPress admin area. Du kanske också vill se vår ultimata Step-by-Step WordPress säkerhetsguide för nybörjare och våra expertval av de bästa WordPress säkerhetstilläggen.

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

137 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. Danang Sukma

    Thanks for your post.
    Im using password protect for my wp-admin folder in cpanel, is it enough?

  3. mby

    uh what a useful info guys, it can help surely!!
    thanks for posting! ^_^

  4. anthony

    This is great information which I will be implementing ASAP!I have already experienced having my blog hacked so have been worried about these issues.Many thanks!!

  5. shoaib hussain

    man m moving from one post to the other in your blog and m loving it it.thnx a lot.guess i’ll have to subscribe now.

  6. Marlin

    Thanks Nice list this will surely help to secure wordpress admin panel.

  7. Jessica

    I’m currently learning wp development. I want to make a ecommerce site with wordpress using the WP e-Commerce plugin. Does anyone know if these tips will keep my ecommerce site secure.

    • Editorial Staff

      Make sure that you have SSL Protection on your e-commerce site for all transactions. These are only to protect your admin area.

      Administratör

  8. Ursula Comeau

    Wow – this is an AWESOME post! Thank you so much for sharing all this information – and some great plugins as well!

    In a world where security has become top priority, these are very important things to be aware of with a WordPress installation. Really appreciate your transparency and willingness to share this information! I’ll be tweeting this one. ;)

  9. Lilia

    The problem with plugins is that they’re not always compatible with every version, and they aren’t always updated.

    • Editorial Staff

      Most plugins are compatible with newer versions, and if the developer decides to leave development of the plugin, others often pick up and create a plugin with fixes for the future releases. You just have to stay active in the community.

      Administratör

  10. Smashing Themes

    Seriously guys, change your site name to WP ROCKER, you guys rock hard. I installed three plugins to protect my admin panel after reading this great post.

  11. Dagmar

    There are also some paid plugins – i.e. ”WP Secure” which also claims it is going to make your WP secure from hackers. It also works on the summary of couple of the principles above – i.e. custom made login page, one IP confirmation etc.

    Is it worthy to purchase? = anybody knows if it is easier to use for non-techie than some of the above mentioned?

    • Editorial Staff

      If you can do the work for free then what is the point in paying?

      Administratör

  12. Kjetil

    Hi
    Thanks a lot for your tips.
    Regarding tip 8, I wonder how to insert the code
    `add_filter(’login_errors’,create_function(’$a’, “return null;”));`
    What is the complete function to use?
    I’d like to try since I already use AskApache Password Protect and that plugin is incompatible with Secure WordPress.
    Thanks,
    Kjetil
    http://www.dolcevita.no

    • Editorial Staff

      You go to functions.php and insert that code. Thats all if we understand your question clearly. If this has not answered it, then please reply to the comment and we will surely take a look at it.

      Administratör

  13. Robinoz

    Thanks for this invaluable information. I’ve just suffered a malware attack that put my blog off line for a day or two while I had my WordPress programmer sort it out. Ver inconvenient.

    I’ll be implementing some of the suggestions you’ve made in the next day or so.

    Robinoz
    http://www.e1jobs-blog.com (All About Jobs blog”

  14. secure server

    good tips for securing wordpress. as time goes we are going to see hosts either become more stringent and secure or cms packages need to implement on install a few more security initiatives.

  15. abbie

    Hi. You’ve written a very good post.

    I’ve rewrote this great post in Indonesian language.
    I really hope you dont mind.
    ;)

    • Editorial Staff

      We have sent you an email regarding this. We do not allow full article translation. Please summarize it and link to our article if your users want to read the full tips.

      Administratör

      • abbie

        Thanks for your response.
        I’ll revise my post. :)

      • Arie

        Hi there..
        I want to ask something for you.
        Besides i has to use askimet, captcha word, storng psswrd, is any other way for hacker to sabotage our web.

        Thats my question, please repp to my mail
        Regards,

        Arie

        • Editorial Staff

          Yes, if your host has vulnerabilities, then the hacker can get you down as well.

  16. John Macpherson

    It took me a few minutes to work this one out but you have the wrong kind of quotes around this function

    add_filter(’login_errors’,create_function(’$a’, “return null;”));

    It should be:

    add_filter(’login_errors’,create_function(’$a’, “return null;”));

    Other than that, great post.

  17. jakesjohn

    What you can from Wp-PreventCopyBlogs WordPress Plugin

    1.Track the visitors who try to copy your content.

    2.Record the ip of the user who tries to do fraudulent copy with their landing url of your site and referral url.This can help you to do necessary measures if you notice something bad.

    3.Enable Message displayed to your user upon user’s choice.

    4.Disable Selection of you text and Right Click for users depending on the option.

  18. Srecko Bradic

    I must congratulate with this excellent article!!! To be honest I know for some tips but some very important info was unknown for me until now!

    Keep on good work :razz:

  19. Soxialize

    Excellent post! Will be testing several of the security tips you provided. Thanks for putting all this together! :)

  20. Heather

    Brilliant post, I think I’ll sleep better tonight!

  21. Henry

    Regarding #6, if you use the following .htaccess file you will be able to login from other locations in a two-step process. This requires you to add a htpasswd file (read your server documentation).

    AuthUserFile ’some htpasswd file’
    AuthGroupFile /dev/null
    AuthName “WordPress Admin Access Control”
    AuthType Basic

    order deny,allow
    deny from all
    Require valid-user
    # whitelist Syed’s IP address
    allow from xx.xx.xx.xxx
    # whitelist David’s IP address
    allow from xx.xx.xx.xxx
    # whitelist Amanda’s IP address
    allow from xx.xx.xx.xxx
    # whitelist Muhammad’s IP address
    allow from xx.xx.xx.xxx
    # whitelist Work IP address
    allow from xx.xx.xx.xxx
    Satisfy Any

    The ”require valid user” and ”satisfy any” lines will force the Apache Server to request a Username and Password before you can access the WordPress Login screen. Please DO NOT use the same Username and Password in the htpasswd file that you use for your WordPress access, or you will defeat the purpose of the extra level of security.

    • Editorial Staff

      Thanks for the suggestion. Post updated with a link to this way as well :)

      Administratör

  22. Laura

    Thanks for the great article. I’m looking forward to making my own blog more secure.

  23. Constantine

    Hi, I have been blogging for 3 years. My blog got hacked in June 2009 and google banned for 30 days, my pageviews immediately slide from 800 a day to less than 100 a day.
    I highly recommend installing wordpress firewall plugin. The plugin will send your an email every time someone tries to hack your blog together with the hackers IP address. The plugin detects and blocks strange requests, redirecting the attack to the homepage.
    On monday i got an email of six attempted hack attempts over the weekend. The hacker tried the admin page three times when that failed he tried searching wordspew plugin which i dont use.

    To all newbies good luck

    • Renee Fischer

      Once a hack is successful the bot or human hacker will keep your data and keep retrying your website files looking for a way back in. they will continue to be relentless. if they have happened to hack your email or computer or server they will keep going until they have hacked everything you touch. they are like cockroaches that found crumbs that led to your house.

  24. Dirk

    In reality 2., 7. and 11. (if not hardened) are the most important things. The other things are nearly unnecessary :)

  25. Typhoon

    Real a very useful article. I tweeted it.

    By the way I want to ask one thing; How does Stealth Login works for guest authors?

    • Editorial Staff

      You give them the special URL that you created if you trust them enough. For the most part, guest authors should not even be allowed in the admin panel unless they are authors of your site. If someone has written multiple posts for your site then they can be trustable so you can give them the special url /login or /googlogin or whatever you created.

      Most top blogs take guest posts via email and if those guest authors become regular authors, only then they are allowed in the admin panel.

      Administratör

  26. Misao

    Thank you! Very helpful article. I will try your tips and hacks on some of my blogs.

  27. sriganesh

    very useful. :lol: :geek: thanks for sharing. i will spred this surely

  28. Tim

    Great tips.

    For the involved readers there is an inaccuracy in #6.

    ”The downside to this hack is that if you ever want to access the admin panel from some other place, you won’t be able to do so unless you add that extra IP in your .htaccess file.”

    If the ip-address you allow is a box you can can SSH into, you can SSH tunnel through it (I use foxyproxy, because it makes the switch very easy). Also, if you are using nginx instead of apache you can evaluate the URI w/ regular expressions to block everything from wp-app.php to wp-trackback.php (or selectively choose which ones you do not want to block). I cover this @ http://www.phrison.com/securing-arbitrary-uris/ but it is not for the unexperienced.

    I have a large collection of tin-foil hats.

    • Editorial Staff

      You are correct.

      Warning: New users don’t try this at all. This is for experienced users only.

      Administratör

  29. SaigonNezumi(Kevin)

    Thanks for this piece. I have been waiting for an article like this. Adding a couple of your tips will help secure my WP sites.

    Thanks again.

    • Editorial Staff

      You are welcome :) Let us know which one you use and your thoughts on the process of implementing it.

      Administratör

  30. Dana DeFazio

    I’m wondering if there is something comparable for my blog because it is a WordPress.com site and also I have a new blog at danaddiamond.BlogSpot.com

    • Editorial Staff

      WordPress.com does not allow you to have a lot of privileges but with their server, you are safe for the most part.

      Administratör

  31. Tinh

    Excellent tips and hacks, I only applied 6 of 11 tips you suggested, let me try the rest

  32. Jo

    This site is a happy new find for me (FYI,thanks to @Problogger on Twitter), and I’m looking forward to further exploration. This article is the kind of tight, clear writing that is too rare these days. Thanks for some genuinely helpful information.

    • Editorial Staff

      We are glad that you like our site, and we are also very glad that Darren found the article useful enough to tweet it. We hope you follow us on twitter so you can stay up to date with all the nice tutorials.

      Administratör

  33. Marc

    Wow – I’m fairly new to WP and had no idea there were so many gateways for hackers. I’m sure they won’t find their way in after adding a few of these.

    Thanks.

  34. Roger Duck

    WordPress security is a growing issue and these steps are critical for securing a WordPress site. Beefing up security helps the entire community as well as your own site to take time to implement these ideas. Well done.

  35. James Morrison

    A good list of vital tips to secure your site. I particularly like #8 I’ve never done this before but will from now on!

    Regarding #7 – Remove ’admin’ username:

    I don’t remove the admin username, I create a new admin account then change the ’admin’ users account type to subscriber.

    That way, even if someone does crack the password it’s a useless account. If you remove it, someone can register that username…

    • Kathlene

      Qwerstion for James Morrison. Can you explain a bit more what you are saying and how to do it?

      For the staff, I have tried a number of times to get a number for the akisnet plugin and cannot seem to come by one. How is one obtained.

      Very nice post. I will be implementing these directly. I had one of my blogs hacked twice in 30 days once.

      Thanks for the great info.

      • James Morrison

        Follow these steps:

        1.) Create a new user account with admin access (eg ’James’)
        2.) Sign in with new account to WP Admin
        3.) Edit ’admin’ users’ account and change access to subscriber

        That way if someone tries to compromise the admin account and succeeds they still can’t do anything bad to your site.

        To get an akismet key you need to sign up for one at http://www.wordpress.com

        Hope this helps!

  36. Cheap Sites

    Thank you for all the suggestions, I’m working on a few big projects and this will certainly help once the blogs are up and running.

    First time here and I’m loving the blog, good job!

    Dan

    • Editorial Staff

      Glad that you like it here. Feel free to make any suggestions if you ever have a question, or would like some specific topic covered at WPBeginner.

      Administratör

  37. Flow Interactive

    Good tips. You can also move your wp_config.php file outside of the web root to provide an extra layer of security.

    • Editorial Staff

      Yes you can do that, but in this article we were only talking about WordPress Admin Panel not the entire site in general. There are many other ways to protect your site entire WordPress blog.

      Administratör

  38. Shabayek

    But what if you allow your blog visitors to register, and force them to log on before posting comments?

    • Editorial Staff

      Then you cannot use the IP protect and others, but you should still use limit lockdown, not use admin username, and semisecure login.

      Administratör

  39. Dreyer

    A helpful list. Will be giving these a go. Better paranoid than sorry.

  40. Rafi

    Hey this is a wonderful collection of tips and hacks, very useful. I recommend every WP blogger to go through the list and follow the steps as well as any other useful resources available elsewhere. After all we have NOT set up our blogs so someone shall take control of our lives. Damn.

    Thanks for sharing, WPBeginner.

  41. Sergej Müller

    Link to WordPress AntiVirus Protection?

    • Editorial Staff

      No matter how much you proofread, some thing are always missed. Glad we have users like you. Link added. Thanks again.

      Administratör

      • Lolic

        What about aksimet and captcha systems?

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.