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.
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.
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
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.
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”.
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.
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.
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.
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.
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.
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.
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.
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:
- Så här fixar du Error Too Many Redirects Issue i WordPress
- Så här fixar du enkelt erroret Den här webbplatsen kan inte nås i WordPress
- Så här fixar du ”Webbplatsen har tekniska problem” i WordPress
- Hur man Fixar WordPress Posts Returnerar 404 Error (Steg för Steg)
- Så här fixar du error med blandat content i WordPress (Step-by-Step)
- Så här fixar du Invalid JSON Error i WordPress (Beginner’s Guide)
- Så här hittar och öppnar du error loggar för WordPress (steg för steg)
- Hur man fixar WordPress som inte skickar email issue
- Så här fixar du WordPress som fastnat i underhållsläge (det enkla sättet)
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.
Helen
this is one of the best tutorial that fixed my issue.. ive tried so many and it just messed my code.
what i did was just delte my htacess and generated a new one.. and im even able to login to my wp admin already
Kelly Taylor-Faye
Thank you. Really helped after a VERY frustrating day to find out it was a broken plug-in. Many thanks
Jen
Thank you so much! This worked!
Benjamin Marlatt
I have tried everything and nothing works!! I then tried re-registering, but that completely wiped out my dashboard. I’m getting extremely frustrated over this!!
Brown
My site doesnt login to dashboard or takes time to load the /wp-login page which after inserting the login details it takes forever to load … but on a different network it loads well what could be the problem
Bethany
Thank you so much for this article! Thankfully mine was an easy fix and I just needed to delete the cookies from WP.org so I could sign in. I had just reset my password before the error occurred where it kept refreshing the log in screen so that may have had something to do with it.
Shay
Hi guys,
I’ve tried everything and nothing worked. I had the same problem with another computer and after about 5 attempts I got in but this morning I tried logging in with another computer, it’s happening again. The page redirects to mysite.com/wp-login.php. Any ideas?
Thanks all for your help!
Patrick Ogbuitepu
LAST RESORT THAT WORKS
You can temporarily disable redirection from the wp-login.php file and then delete all newly installed or updated plugins.
1. Disable redirection by opening the file wp-login.php
2.Scroll down to the line where you have the code ”do_action( ”login_form_{$action}” );”
Mine was around line 461
3. Comment out that line of code to disable redirection
4. Save the file. You will now be able to login using example.com/wp-login.php
5. Disable or delete all recently installed plugins especially plugins that manage access control functionalities
6. Clear your cookies and cache
Luqman Arif
Thank you so muchhhhh!!!.Finally i can access my admin site.after 2 days struggling.
Luqman Arif
Should i continue to comment the codes?because i am not sure which plugins that cause the problem.Before this i have disable all the plugins manually, but still cannot access wp-login.php.
Slav
Tylko to mi pomogło. Wielkie dzięki!
nirmal
define(’WP_HOME’,’http://example.com’);
define(’WP_SITEURL’,’http://example.com’);
i change this examples.com to my site url, now not able to login. it shows 401 unauthorized. After changing the original file wp-config also, not able to login. any idea?
WPBeginner Support
Hi Nirmal,
Try adding with www like this:
1-click Use in WordPress
Administratör
Paul
Turned out to be one of my plugins that was giving me grief, simply went into my Ftp and deactivated them and got rid of the last plugin that i installed, happy days fixed the problem, many thanks guys your knowledge is invaluable , respect!
Oliver McLeod
Great thank you I appreciate it. Clearing my cookies worked.
Graham Campbell
Tried these to no avail. My host says ”The site ran out of space” except that there is 3gb free, so that’s not true. This problem is on 40+ sites and happened at the same time, so it’s not me but I have grumpy customers expecting me to fix it.
Site works but login does not,
I get :
https://example.com/wp-login.php?redirect_to=https%3A%2F%2Fexample.com%2Fwp-admin%2F%3Fdoing_wp_cron%3D1512599810.4524919986724853515625&reauth=1&doing_wp_cron=1512600006.5833470821380615234375
Any thoughts welcome. Thank you
WPBeginner Support
Hey Graham,
Here are a few things you can try:
1. Set ALTERNATE_WP_CRON to false in your wp-config.php file.
2. Deactivate all WordPress plugins and turn them on one by one.
See our WordPress troubleshooting guide for more steps.
Administratör
Abby
Finally! The delete .htaccess file works fine for me! Also have to go to Settings > Permalinks and click Save to generate a new .htaccess file.
August P
How can I go to Settings > Permalinks if i can’t log in to the dashboard????????
WPBeginner Support
Hi August,
If you cannot login to your WordPress site, then you can refresh permalinks via FTP. Simply connect to your website using an FTP client. After that download your .htaccess file to your computer as a backup. Now delete the .htaccess file from your server. You can now try to log in to your website.
Once logged in you can go to Settings > Permalinks page and click on the save changes button to generate new .htaccess file.
Administratör
Andrew See
My problem was customers needed to try login 3 times before it goes through for Chrome, IE and Opera but not for Firefox users. I am using Woocommerce and WP (currently the latest although it started happening about the last upgrade or earlier). Tried clear cache, delete htaccess. Didnt work. The following worked:
Added a new page and re-direct the ”Woocommerce|Account” (login) page to the new page.
This worked. I then pointed the Account page to the original Account page and it worked. Guess something got refreshed. Thanks for the tips anyhow.
Gina
after changing site URL through the dashboard the whole site went to 404. Your define(’WP_HOME’,’http://example.com’);
define(’WP_SITEURL’,’http://example.com’);
solved that issue, but now I need to move my site to the root directory and don’t know how because of this fix.
HELP!
Phil
Thanks for the guide.
Updating the site URL using
define(’WP_HOME’,’https://example.com’);
define(’WP_SITEURL’,’https://example.com’);
Worked for me
Rui Santiago
I have tried every single step and no success… what should i do now??
Jason
Pro Tip : I have the same problem, check your wp-config.php file and locate : WP_ADMIN_COOKIE_PATH or ADMIN_COOKIE_PATH and erase it!
Jon
All of these steps did not fix my problem.
I think I’ve found part of the cause though.
When I type in mysite.com/wp-admin I am redirected to mysite.com/wp-login.php only the redirect is incorrect.
Rather than redirecting to mysite.com/wp-admin after login it is redirecting to mysite.com/domains/mysite/wp-admin
Any help out there for fixing this?
TH
Hi.
I moved my site from my local host to live following the steps in your article related to that.
I faced some login/redirect issues.
I tried all the steps as listed in this article.
When I revert back to default theme, the page only shows a text of my domain name with no other content.
When I delete .htaccess file, it shows my home page but when I click on login button it shows 404 error NOt Found
When I update site url, I also get 404 error when I click on login button or go to domain/wp-admin
What else can I try to troubleshoot?
Will appreciate your help.
Thanks.
Geetika jain
I am not able to understand what is the problem with my website. In home page after 5 posts i am not able to post anything, in the dashboard, it redirects me to the post page. and revolution slider is not activating in my site.
Richard Payne
I can not log in it gives me a page can not be founed I think it is because my web page name was altered in an plug in
Dan
Everytime I log in I am redirected to the My sites page (light Blue) I want to go directly to the standard dashboard. Can someone help me fix this problem
amacn
hI! I have just paid my renewal and when I try to login to my account it keeps telling me error?? Why is this ?? Thanks.
John D'signer
thanks a lot..this is so helpful to retrieve wp site as mush as easier way.every pin points are so understandable and worth to try it.oncw again thank you so much
Adele
Why can’t I access my Wordpress dashboard anymore? It’s driving me insane. I have tried resetting the password, several times, but it keeps telling me there is no account with that name. I need to publish a blog but I can’t. HELP!
WPBeginner Support
Hi Adele,
Instead of username, try entering your email address in the username field to login. This should be the same email address you used to reset password. Hope this helps.
Administratör
Moha
Thanks a lot, you’ve saved the life of my web! Love you guys!
Arfat Malik
It worked when I opened it in Incognito browser. thanks
Mumbere Ausbel
Thanks so much. your info helped me out
chuck
I could not login to wordpress site went to cpanel and deleted plugin I just installed and fixed problem
Atif Sharif
My site also fixed with last two lines added in wp-login.php file thanks for sharing
Koupe lakay
The last one worked for me
Giorgio Mula
Hi there,
I have a weird issue with login on WP: my problem arise with domain redirect because I have a wp site into a subfolder of my domain (www.example.com/site) and a redirect from my provider (www.example2.com) that I setup to point at http://www.example.com/site.
WP works great except for ”login”: I can access from http://www.example.com/site but not from http://www.example2.com. From this last one it happens that pushing ”Login” button simply get no result. Do you have any idea? Both WP_HOME and WP_SITE_URL point to http://www.example.com/site
Thanks a lot for your support and your amazing site
WPBeginner Support
Hi Giorgio,
We are not sure we understand your issue correctly. However, it seems like example2.com is already redirecting to your other website. In that case, you’ll not be able to login from there.
Administratör
Tariq
I am running a WP website, Its about mobile products tells Specifications and features of smartphones. I tried to activate a price filter plugin for my website but they said I have to activate the woo commerce plugin first then filter plugin will work. I did that. But it was a big mess. so I delete the both woo commerce as well as the first one price filter plugin. But now I am facing an issue. when ever I click on my any product on my website or from google search result it comes back to my site homepage. Can anyone help me out about it? I am a beginner. Thanks
Mike
Thanks a million! Deactivating Plugin fix worked perfectly!
Salman Ansari
i Just copied all the wordpress folder to one site to another & Import All my database but… after login, page redirect to previous site….
what should I do?
Phil
I have tried all what you said and i”m still getting a 404.php error when
i try to login to http://www.example.com/Blog/wp-login.php
If I reinstall WP on the server, will I loss all my blog posts?
since I cannot login to Dashboard.
Thanks,
Phil
WPBeginner Support
Hey Phil,
Before you reinstall please try these:
1. Try to access login page by visiting http://www.example.com/wp-login.php
2. Try updating your permalink structure. Connect to your website using an FTP client or File Manager in cPanel. Locate the .htaccess file in the root folder of your website. Download the file to your computer as a backup and then delete it from your website.
Administratör
Vincent Sabatia
Had the same problem though all I had to do was to reset my admin user password to something stronger, cleared the browser cache and everything started working fine
Denise
None of these solutions worked for me, nothing. I was completely perplexed. Finally, I went to the Wordpress forum on my hosting site, Dreamhost, and found a thread about login problems. Turns out I didn’t have my auth keys and salts defined. A quick cut and paste into my wp-config.php file and boom! I’m in! So my addition is to check with your hosting service and see they have specific instructions or recommendations. IDK why my wp-config.php was wrong in the first place, but so glad I found the fix! This has been frustrating!
Marcelo Muianga
Thank you so much, deleting the .htaccess did the trick, just remind people to show hidden files on file manager html root of their cpanel
Aman Potlia
hey thanks your last method update url method really works for me. now i am able to log in my wordpress admin panel
Brad
Super helpful, thank you. I had 2 or 3 plugins running that did logins and membership and they basically made my site inaccessible.
Graeme
The site url option:
define(’WP_HOME’,’http://example.com’);
define(’WP_SITEURL’,’http://example.com’);
worked for me. The problem happened when I moved a site from a .co.nz to .nz url.
Thanks.
Awais Khalid
Sir i have uplaod database file and and backup for my old website on new domain but it is redirecting to old website and i am unable to access Wordpress Login page
WPBeginner Support
Hi Awais,
You will need to change the site URL. You can do that in your wp-config.php by adding this code:
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
Administratör
David ACQ
Last option worked for me just fine (Update Site URL)
define(’WP_HOME’,’http://example.com’);
define(’WP_SITEURL’,’http://example.com’);
I wish i could know what caused the problem and why that solution was the one that worked, in order to prevent having this issue again and be alert of else issues could produce the origin problem.
Bakkiya
Having a problem login into wordpress wp-admin page. No error messages, but keep getting redirected to the login page itself.
Wrong credentials return appropriate error message, but not in this case. No white screen of death also. Just the login page reappearing, after shaking a couple of times.
Tried all suggested methods, including clearing cookies, deactivating plugins, deactivating theme. And deleting .htaccess, making appropriate entries for site url and home url in wpconfig, enabled wp_debug too. Tried all tricks recommended.
Interestingly, this has happened in two different servers, with two different staging sites (both in advanced stages of development) – on two different servers…one windows, one linux. These were working fine till last night…and then this sudden has happened since morning.
Can any one suggest what the problem could be?
Nithin Bhaktha
Well I had the same problem yesterday just after installing Wordpress. Check in your host cPanel if varnish caching has been enabled. If so, go ahead and disable it. Wait for 30 minutes and then try logging in.
Tushar
You my friend deserve a pat on the back. After struggling for nearly the whole day and trying everything else out, your solution is what finally worked. I disabled varnish and voila, I am in
Kapil
Superb..that worked for me too. Thanks.
Siddhesh
Nothing work for me ? dont know how to fix it? please help ?
Cant login to wordpress dashboard
it says sorry you are not allowed to access this page
Sheila King
I was locked out. At first I doubted my password and tried to get a reset but my admin log in page was just doing circles with my website front page. I tried every action suggested – even managing to get the dreaded blank, white page.
So I started putting everything back as it was to try again another day. But with a deleted .htaccess file and the theme and plug in still deactivated I managed to get a password reset from WP – I’m in!
Thank you to everybody who commented.
Muhammad Aqeel
follow this tutorial A to Z problem not solved. i couldn’t login to my wp-admin since i migrate my wordpress website from localhost wamp to web server using cpanel. the front end design not rendered properly and also i couldn’t login to my wordpress admin
Javier Madrid
The last option worked for me: ”Update Site URL”
Thank you
christopher
Just learned this … from a Bluehost help desk. To see what’s on the server press Shift/ Reload
Cathy Ford
I have a slightly different problem — when I am logged off wordpress and on my website when I click on the main menu to select a page I get redirected to the Wordpress Login page. It is sporadic and seems to happen with several different links. This is also happening to visitors to my site so it’s not just my computer. .
Thanks, Cathy