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 problemet med att uppdatera och redirecta login page på WordPress

Uppdateras och redirectas din login page i WordPress hela tiden när du försöker logga in på din website?

Denna issue låser dig ute från WordPress admin area, vilket gör att du inte kan arbeta på din website.

I den här artikeln visar vi dig hur du fixar problemet med att uppdatera och redirecta login page i WordPress.

Fixing the login page redirect and refresh issue in WordPress

Vad orsakar login page uppdatera och redirect issue i WordPress?

WordPress login page refresh and redirect error orsakas vanligtvis av felaktiga WordPress URL-inställningar eller misslyckande med att ställa in inloggningscookies.

När du loggar in bekräftar WordPress normalt ditt användarnamn och password och sätter sedan en login-cookie i din webbläsare. Efter det redirectas du till WordPress dashboard.

Om WordPress Misslyckas med att ställa in login-cookien korrekt eller om din URL för WordPress admin area är felaktig, kommer du att redirectas tillbaka till login-skärmen istället för adminpanelen.

Login page redirect issue in WordPress

Problem med login kan också orsakas av olika WordPress fel, t.ex. error establishing database connection, internal server error eller white screen of death.

Med detta i åtanke, låt oss felsöka och fixa WordPress login page redirect and refresh issue. Du kan använda dessa länkar för att hoppa till en specifik metod:

Obs/observera : Om du vill prova de avancerade stegen i denna WordPress tutorial, vänligen skapa en backup av din site först. Se vår guide om hur du manuellt skapar en backup av WordPress-databasen.

Video Tutorial

Subscribe to WPBeginner

Om du inte gillar videoklippet eller föredrar den skriftliga versionen istället, vänligen fortsätt att läsa.

Metod 1: Clear Cookies för att lösa problem med login

WordPress använder cookies för autentisering av login, så det första steget i felsökning av WordPress login-problem är det enklaste. You will need to clear your browser cookies and cache.

I Google Chrome klickar du bara på menyn för inställningar i webbläsaren och väljer sedan More Tools ” Clear Browsing Data.

Clear browsing data in Google Chrome

Detta kommer att starta Chrome Settings page med en ”Clear Browsing Data” popup displayed on the screen.

Härifrån måste du välja alternativen ”Clear cookies and other site data” och ”Cached images and files”.

Clear cookies and cache in Google chrome

Klicka sedan på knappen ”Clear data”, så kommer Google Chrome att rensa webbläsarens cache.

Kontrollera också att cookies är aktiverade i din webbläsare. När du har gjort det startar du om din webbläsare och försöker sedan logga in. Detta bör fixa problemet för de flesta.

Vi har en komplett guide med screenshots som visar hur du clearar cacheminnet och cookies i alla större webbläsare.

Metod 2: Update WordPress URL Settings

WordPress levereras med inställningar för URL:en till din website och URL:en till din WordPress install.

Om du hade tillgång till din WordPress admin area, då kan du se detta alternativ på Settings ” Allmänt page.

WordPress URL settings

Om dessa URL:er är felaktiga kommer WordPress att redirecta you tillbaka till login page.

Eftersom du inte kan komma åt WordPress admin area, måste du editera wp-config.php-filen för att fixa denna issue.

Filen wp-config.php är en speciell fil i WordPress som innehåller dina viktiga Settings för WordPress. Du kan komma åt den med hjälp av en FTP-klient eller via appen File Manager i adminpanelen för ditt WordPress-webbhotell.

Editing wp-config.php file via FTP

Du hittar filen wp-config.php i din sites rotfolder. Du behöver bara editera filen och klistra in följande rader med kod precis före den som säger ”That’s all, stop editing! Trevlig publicering”.

define('WP_HOME','https://www.example.com');
define('WP_SITEURL','https://www.example.com');

Glöm inte att ersätta ”example.com” med ditt eget domain name.

Efter det, save dina ändringar och upload filen tillbaka till din website.

Du kan nu besöka din WordPress website och försöka logga in. Förhoppningsvis har detta fixat problemet för dig. Om det inte gjorde det, fortsätt att läsa för ytterligare steg för troubleshoot.

Metod 3: Radera .htaccess-filen i WordPress

Ibland kan .htaccess-filen bli skadad, vilket kan leda till interna fel på servern eller att login page uppdateras error.

Gå bara in på din website med en FTP-klient eller via File Manager-appen i hosting providerns dashpanel.

När du är ansluten letar du upp .htaccess-filen i root directory på din website och downloadar den till datorn som backup.

Om du inte kan hitta din .htaccess-fil kan den här guiden om varför din .htaccess-fil kan saknas hjälpa dig.

Delete .htaccess file in WordPress

Därefter går du vidare och tar bort .htaccess-filen från din website.

Öppna sedan wp-admin directory, och om det finns en .htaccess-fil där, fortsätt och ta bort den också.

Du kan nu försöka logga in på din WordPress website. Om du lyckas betyder det att din .htaccess file hindrade dig från att logga in på WordPress.

När du är inloggad går du bara till Settings ” Permalinks page i adminpanelen i WordPress och klickar på knappen Save” utan att göra några ändringar. Detta kommer att generera en new .htaccess-fil för din website.

Metod 4: Deactivate alla tillägg till WordPress

Ibland kan WordPress plugins orsaka denna issue, särskilt om det finns en konflikt mellan två plugins.

För att enkelt deactivate alla dina WordPress tillägg, anslut till din website med hjälp av en FTP-klient eller via File Manager appen i adminpanelen på ditt webbhotell konto.

När du är ansluten går du till /wp-content/ directory. Inuti den ser du en folder med namnet ”plugins”. Det är här WordPress installerar alla dina tillägg.

Rename plugins folder to deactivate all plugins

Byt helt enkelt namn på plugins folder till ”plugins_backup”. Detta kommer att deactivate alla WordPress tillägg installerade på din website.

Vi har också en detaljerad tutorial om hur du deaktiverar alla WordPress tillägg när WordPress admin är otillgänglig.

När du har deactivate all plugins, försök logga in på din WordPress site. If you succeed, then this means that one of your plugins was causing the issue.

Metod 5: Återgå till standardtema

WordPress themes kan också orsaka konflikter efter upgrading till en nyare version av WordPress eller själva temat. För att ta reda på om problemet orsakas av ditt theme måste du deactivate det.

Processen liknar deactivate av tillägg. Anslut till din website med hjälp av en FTP-klient. Sedan måste du gå till /wp-content/themes/ directory och byta namn på din nuvarande theme-katalog till ’themes_backup’.

När du har gjort det kan du försöka logga in igen. Om you lyckas, betyder det att your theme orsakade the issue.

Du kan nu installera om en ny kopia av ditt theme för att se om detta löser issue. Om problemet återkommer måste du kontakta supporten för ditt theme eller byta till ett annat WordPress-tema.

Metod 6: Installera om WordPress Core

I sällsynta fall kan det ihållande problemet med att uppdatera login page orsakas av skadade WordPress core-filer.

Dessa core-filer utgör grunden för din WordPress website och hanterar viktiga funktioner. Om dessa filer skadas eller skrivs över med felaktig kod kan det leda till olika error, t.ex. problem med login.

Först går du till WordPress.org och downloadar den senaste versionen av programvaran. När du har downloadat filen packar du upp den på din dator. Detta kommer att skapa en folder med namnet ”wordpress” som innehåller alla nödvändiga filer för ominstallationen.

WordPress files

Därefter måste du ansluta till din website med hjälp av en FTP-klient eller filhanteraren som tillhandahålls av ditt webbhotell.

När du har anslutit dig navigerar du till rotmappen på din website. Detta är huvudkatalogen som innehåller foldrar som gillar wp-admin, wp-content och wp-includes.

Upload core WordPress files

I det här skedet ska du hämta alla filer från mappen ”wordpress” på din dator och uppladare dem till din websites root directory.

Your FTP client will ask you to confirm overwriting any existing core files.

Eftersom du ska borttaga skadade WordPress core-filer och ersätta dem med new, välj ”Overwrite” och välj alternativet ”Always use this action” för att slippa bekräfta varje fil enskilt.

Overwrite core files

Klicka slutligen på ”OK” för att påbörja uploaden. Din FTP-klient kommer att ersätta WordPress core-filerna på din website med de nya filerna från din dator.

När uploaden är completed, besök din website för att se om error är fixat. Om login-problemet orsakas av en skadad core-fil eller skadlig kod bör felmeddelandet vara borta och du bör kunna logga in utan problem.

Learn More Lösningar för troubleshoot av WordPress

Upplever du andra vanliga WordPress error och behöver hitta ett sätt att fixa dem? Här är andra artiklar som du kan kontrollera:

Vi hoppas att den här artikeln hjälpte dig att lösa problemet med att WordPress login page uppdateras och redirectas. Du kanske också vill se vår kompletta guide för felsökning i WordPress eller kontrollera våra toppval för de bästa WordPress-tilläggen och tools för att utveckla din site.

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

357 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. Eric

    I had to rename /wp-content/object-cache.php. Hope that helps for anyone who the other steps don’t work for.

  3. Alisha

    When i type myurl.com/wp-admin the page shows blank. I can’t see any login panel either nor does my website opens… what is the cause? :(

  4. Akeem

    editing the wp-config worked like a charm. thank you so much!

  5. Jeff

    If you are having this issue, and nothing suggested here will work – log into the Cpanel and go into PHP My Admin, run a repair on your database table.

  6. Micah

    Adding the code to the wp-config.php solved this for me.

    define(’WP_HOME’,’http://example.com’);
    define(’WP_SITEURL’,’http://example.com’);

    Thanks for the article! It took me 3 hours sifting through other posts before I found your post and the resolution that I needed!

    Micah

    • MuhdNurHidayat

      Thank you very much! You saved my day!!

  7. Gordon

    This problem can also occur if your server hosting WordPress has run out of disk space. Freeing up disk space can solve it.

    • Victor

      You saved my day. I lost hours trying to find what the hell was wrong… thanks dude

  8. Angelo

    Deleting the .htaccess worked for me. Thank you

  9. Friday0

    Sir please help me look at what am getting it started this night.

    Fatal error: Call to undefined function
    wp_is_mobile() in /home/u318928021/
    public_html/wp-login.php on line 39

    I don’t know what to do

    • WPBeginner Support

      Seems like a plugin or your WordPress theme is causing this error. Deactivate all your WordPress plugins and check if this resolves your issue. If it does then you need to reactivate plugins one by one. This will help you find the plugin causing the error. If deactivating all plugins does not resolve the issue, then switch to a default WordPress theme like Twenty Fifteen. If switching theme resolves the issue, then the problem is your with your WordPress theme.

      Administratör

  10. Luis

    Thanks, it was a plugin conflict. I just deleted some useless crap via ftp and now it’s all sorted.

  11. Thomas Le Coz

    You guys saved my ass. I was stuck outside a client site after messing with a SSL certificate and some stuff on managed account.

    Never encountered this issue before, got saved by your guide.

    Thanks ;)

  12. Eva Duli

    Nothing of these work for me. I want to work the site localhost but when I am trying to login in the admin it redirects to the old admin login. Do you have any idea?

  13. Marco Panichi

    My problem was that I hadn’t renew the database and the provider denied my user to insert/update the database.

    The error I received was: ”INSERT command denied to user ’Sqlxxxxxx’@’xx.xxx.xxx.xxx’ for…”

    So the solution in my case was:
    1) activate the debug into wp-config.php > define(’WP_DEBUG’, true); in order to discover the problem
    2) renew the database

    Hope this help!

  14. JohnnZenith

    I have a wordpress.com blog and all these instructions either are not relevant or I do not understand them, so I guess i’m going to leave it.

  15. chris

    I cant find my .htaccess file? I can find it in my rootfirectory but not on my subdomain (where I have a whole new wordpress site). What do I do? It is my first time ever to log in to my subdomain wordpress.

  16. Kenny

    The dreaded Internal Server Error and web host support quickly identified a corrupted .htaccess. Spent next 3 hours trying to find how to use my ImportBuddy when I didn’t have WP Admin access. Finally thought to check WPBeginner, found the .htaccess issue above and 30 seconds later had fixed the issue. Next time I come here first!

    Thanks guys and gals.

  17. Drew

    Changing the wp-config.php file did it for me! This is the second time I’ve had this issue in two weeks, so I think the fix via htaccess was only a temporary solution.

  18. joel

    Seriously a life saver! Corrupted .htaccess files was my issue. But following your steps helped me solve it. Much, much appreciated!

  19. Sumdi

    Its working

    Have rename .htaccess and update WP_HOME, WP_SITEURL to proper URL in wp-config.php file….

  20. rubenjm

    I had this issue, tried all these options and none worked for me.
    Finnally solved it… apparently my database was overloaded!! I had to login through phpmyadmin and delete and clean some tables. Hope it helps someone!

    • Moises

      Which tables clean you?

  21. Liviu

    I did all of the proposed solutions, but nothing works for me! It keeps refreshing and redirecting it back to the login screen. Changing the folder of my current theme gives the white screen of death. It doesn’t revert to the default theme. Any other idea, please?

    Being at a dead end, I’m thinking to download all the site through ftp, make a new one site from WordPress and then upload one by one all my content. I’m worry however if I’ll be able to insert all the customization settings afterwards. The current theme was made custom by another person which cannot help anymore. Is it safe to do that? Thanks!

  22. Mary Anne

    Thank you so much. I have WordPress pages built via my account with bluehost. One of my wordpress sites stopped working. I had the white screen of death.

    I followed each step in order, until I found the step that worked to resolve my problem. The step that worked for me was, Revert Back To Default Theme. Instead of using an ftp though, because I was having a hard time with my fetch working, I logged into my bluehost account and went into my file manager and then accessed my wpcontent/themes/directory that way for changing the title of my current theme.

    this worked perfectly. I was able to log back in and choose a different theme. Thank you again

    Mary

  23. Manish

    Hello,

    Its not working for me. I had made every change into my site as per this tutorial still no luck. Added these two line in web config file.

    define(’WP_HOME’,’http://www.siteurl.com’);

    define(’WP_SITEURL’,’http://www.siteurl.com’);

    deleted .htaccess file. but still same problem. My site running on 1&1 hosting.

    Please help me.

    Thanks
    Manish

    • Umair

      Dear manish , there is small change use it will definitely work

      1define(’WP_HOME’,’http://example.com/wp-admin’);
      2define(’WP_SITEURL’,’http://example.com’);

  24. Claudia

    Update Site URL worked perfect for me! Thank you!

  25. Louis

    Noting work for me… wp 3.9.1, Hostpapa hosting.

  26. Beck Abad Lastimosa

    I have had my site for more than 6 months now and I finally decided to transfer hosting. After the transfer was successfully done, I as still able to access my login page. But these past few days has been a nightmare! I am was able to login to WP under the new DNS but as of this time, this problem suddenly occured:

    – Everytime I login to WP admin, I should see the login page right? But what I get is a download of wp-login.php. I have tried checking issues ith the guide of WP Codex. I tried contacting GoDaddy (my new host) but they told me they do not handle coding, etc. Right now, I’m on a dead end! I have tried different browsers but I still get a download of wp-login.php instead of the login page showing itself.

    I ould really appreciate it if you can help me.

  27. Thilip kumar

    I Check with all the above but unable to login, I can ablre to see the login window, after I submitting login form. I Displays ’.’ (Dot symbol)

  28. Alison Withers

    You’re a godsend!!! Editing the config file to define the site address again did the trick.

    • Jaka

      YES! This did it for me too. Magic! Thanks!

  29. Isak

    Did all of the above, nothing works. My main wp-login.php redirects me to one of my subdomains.

    This is how the redirect problem occured:
    1. My web hotel shut down my site, saying that it had been infected with malware.
    2. I changed all my passwords via PhpMyAdmin as well as to the database.
    3. I manually updated WP in my root directory as well as 2 out of 3 subdomains (the 3rd one already had the latest version) by uploading the new files and replacing the old ones, since I was not allowed to access my WP admin area.
    4. I manually added a .htpasswd and .htaccess to my root WP install and tried to access wp-login.php. I tried my 3rd subdomain (the one with the latest install of WP) first and it worked. After that, I tried my main domain and came to a page saying ”update database”, so I did. After that I tried again, but every time I try to reach my root install or any of the other subdomains, I get redirected to my 3rd subdomain.

    Any ideas?

    • WPBeginner Support

      Open the wp-config.php file on the root site. Add these two lines to your wp-config.php file:

      define('WP_HOME','http://example.com');
      define('WP_SITEURL','http://example.com');
      

      Replace example.com with your own domain. Also delete .htaccess file from all your subdomains and root domain. Once you get access to WordPress admin area on your root domain you need to go to Settings -> Permalinks and just save your permalink structure.

      Administratör

  30. Jesse

    Deleting .htaccess file from root directory worked for me. Thank you!!!

  31. Moaz

    none worked for me!

  32. Diane

    The extra lines in the wp-config worked! I love you! Thanks :)

    • carl

      WP-config worked for me too! I could kiss you!

  33. Jonny

    WP_SITEURL did it for me. Seems illogical but it worked, so thanks for the tip! This only started happening recently to me – I wonder if it’s more prevalent with subdirectory installs with newer versions of WP.

  34. igor

    ok I deleted all plugins and it works but whenever I add any plugin it does the same thing

  35. Anna

    Thank You :)

    It was really helpful, great info … Resolved y issue by adding site name in wp-config.

    Regards,

  36. Peter Evans

    Recently WP started getting me to login ever 5 of so minutes. I noticed that my wp-config.php did not have the following lines
    define(’WP_HOME’,’http://example.com’);
    define(’WP_SITEURL’,’http://example.com’);

    and when i inserted then the need to login was a less but I was then told that my session has expired and I needed to relogin in.

    This is very frustrating and I would be greatful if you could assist me. I am using WP 3.6.1

    Peter Evans

  37. Aamna

    and Yes if your wp-config.php file does not provide you a solution.
    Try going to functions.php of your theme via ftp and add same two lines right below the <?php line and upload again. here you go !!!
    it works for me :)

  38. Aamna

    Thanx a lot the site URL was the solution … Thank you Thank you Thank you

  39. W.J.Kok

    I use Epic Browser for testing because that browser will not store cookies (by default). Therefore clearing the caches will not delete all my stored passwords in the process.

  40. W.J.Kok

    Set chmod wp-admin at 750 did kill my admin login access. So, now I use 755.

  41. Brent Norris

    Had a special case of the redirects all day. This particular post, out of about 20 keyed me in on a solution. Just wanted to say, ”thanks!” Your perspective was a refresh after ten hours chasing down a solution.

    It was the part about generating a new .htaccess file that made the difference for me. Wish I could be more helpful to others but the problem I was having wasn’t very related and wouldn’t make a lot of sense to your readers.

    Aloha

  42. Adrian

    Thanks a lot for the ’Update Site URL’ fix. That solved an issue I was battling with for a while and saves me from any further headaches.

  43. Omar

    This was really frustrating me but thanks to your tip on updating the URL my site is now working. Thanks!

  44. Haseeb Ahmad Ayazi

    This error is very rear with WordPress but mostly occir in Blogger

  45. Paul

    I normally get this error when working with multisite, normally it’s a cookie path problem which can be fixed by changing the wp-config.php.

  46. Robert Connor

    I really needed this tutorial it happens to me all the time usually a plug in conflict. I am addicted to plugins. Thanks staff! Have a great day on purpose…

  47. Kartik eye

    I had the same issue, few days ago. I was trying to enable the wpmultisite function for my new website with sub directories. My website is hosted on bluehost. I did everything step by step. But after editing all the files like wpconfig.php and htaccess. When I finally tried to login, I was getting a redirect to the same wp login page. I disabled the multiste and then everything was fine again. Please can you help with this?

    • lelebon

      I tried everything — I said every little advice here — to no avail. Until I noticed I was using wp_config.php instead of wp-config.php. That simple! It solved my problem. HURRAY!!
      Anyways, thanks for the tips. Hope I can help someone too.

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.