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.
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!
Stef
None of this worked for any of the sites we tried this on
WPBeginner Support
If none of the methods in this article were able to solve the issue on your site we would recommend reaching out to your hosting provider and they should be able to see if there is a specific error on their end.
Administratör
Amnon Jakony
Deleting htaccess file worked fine for me…
WPBeginner Support
Glad to hear it was able to help you!
Administratör
Harry k
Thanks for this video and the post. I tried above all of your methods but none of them fixed the issue. read the comment and found a solution as below. Edit HTTPS to HTTP.
define(‘WP_HOME’,’https://example.com’);
define(‘WP_SITEURL’,’https://example.com’);
to
define(‘WP_HOME’,’http://example.com’);
define(‘WP_SITEURL’,’http://example.com’);
WPBeginner Support
The issue with this method would be that your site would start to show the not secure message as your site would not be using HTRTPS. This can be a temporary workaround but you would want to update your site to use HTTPS after you are able to log in.
Administratör
Tobias
No luck none of them worked
WPBeginner Support
If none of the methods from this article are working for you, we would recommend reaching out to your hosting provider for them to check if there are any errors on their end.
Administratör
Salah
Thanks a lot,
You saved my day,
I have changed the file wp-config.php as described in the tutorial and that worked for me.
My best regards.
WPBeginner Support
Glad to hear our guide was helpful!
Administratör
Robert clancy
I messed around with the Update WordPress URL Settings
and that was a world of pain to correct as it took my whole site down. I had to correct it through changing the config settings using FTP.
WPBeginner Support
The settings are definitely powerful and can cause issues if you change them incorrectly. Glad you were able to fix the issue using FTP!
Administratör
DK John
Your first method worked for me. Thank you for this magical guide
WPBeginner Support
Glad our guide was helpful!
Administratör
David Kuteesa
Tried all and none worked. Here is what worked:
Went to wp-config.php and set define( ’WP_DEBUG’, false); to define( ’WP_DEBUG’, true );
Tried logging in again and got ”usermeta table missing” error.
Thats when I realised I had a missing table. Got it from another installation and changed the table prefix to meet current db.
Worked immediately
WPBeginner Support
Thank you for sharing this, for most beginners we recommend reaching out to their hosting provider if our recommendations do not work as they can check for less beginner friendly errors.
Administratör
Stian
Thank you – that tip about restoring the admin page by adding two lines of code in the config file seems to work nicely (still crossing fingers), but I have hope now, which I didn´t earlier.
WPBeginner Support
We hope it helps!
Administratör
WPBeginner Support
Glad our guide could help and if you hadn’t set up SSL before changing to https that would definitely be the most likely cause.
Administratör
branhampaul
Thank You, it worked.
I initially had the siteurl & wp address url changed to ”https”, and this made me unable to log-in my dashboard. Maybe because I had not ssl at my host set-up.
Re-changing the ”https” to ”http” helped me log-in back.
Bryan Veloso
Everything didn’t work. But after downgrading my PHP from 7.4 to 7.2, I was able to login.
Kinda weird, now I’m using an older PHP version.
Did you encounter an issue similar to mine? I want to use the newer PHP version, but it doesn’t let me login in wp-admin.
WPBeginner Support
More than likely, you may have a plugin causing a conflict, you would want to start by following our troubleshooting guide below:
https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Administratör
Alisha
This issue has never happened to me before, but the 2nd / plugin option worked for me right away.
This website is a lifesaver! Thank you so much!
WPBeginner Support
Glad our guide was helpful
Administratör
Øivind
Thank you! The wp-config.php-metod worked for me!
WPBeginner Support
Glad our recommendation was able to assist
Administratör
Ruta
I tried some of these steps, but the problem turned out to be elsewhere: my site was setup as a ’multisite’ but in wp-config file it said ’subdomain_install’ as ’false’, when I changed it to ’true’, I could login to the site normally without redirects
WPBeginner Support
Glad you found the solution to the issue
Administratör
Jerry
This was also my problem! I tried all the steps mentioned in the article, but after changing the ’subdomain_install’ from false to true in the wp-config.php file it worked!!
Thanks!!
Joe
I have been trying to solve this for MONTHS… Thanks to your comment, I was able to fix it in about 10 seconds. Thank you so much for sharing!
This should be included in the tutorial.
Brayton Scott
Awesome, and simply tutorial. 1st suggestion fixed my site.
WPBeginner Support
Glad our recommendation could help
Administratör
Fraser
I followed the instructions to deactivate all plugins and I now have access to wp-admin again! The instructions were easy to follow, and thanks so much for putting them out there.
WPBeginner Support
Glad our article was helpful
Administratör
Sachin Baikar
Thanks for this great help. The plugin folder renaming worked for me. There was an issue with one of the plugins. Thanks once again
WPBeginner Support
Glad our recommendations were able to help
Administratör
E
Thank you for this article. It is a complete lifesaver.
WPBeginner Support
Glad our guide was helpful
Administratör
Philipp
I was looking for a solution for over 5 hours now – nothing worked. But deleting the htaccess file in the wp-admin directory helped!
I cant thank you enough.
Made my day.
WPBeginner Support
Glad our recommendation helped
Administratör
María González
Thank you! You just saved my life (at least my job!) and a loooot of time (:
WPBeginner Support
Glad our guide was able to help
Administratör
Suraj Handa
Hey but now its showing that cookies are disable in your browser please enable cookies. What can I do now?
WPBeginner Support
There are a few possible reasons for a starting point, you may want to clear your cookies and cache to be safe. For a starting point, you may want to take a look at our article below:
https://www.wpbeginner.com/beginners-guide/how-to-clear-your-cache-in-wordpress
Administratör
charlie
just refresh the page, the wordpress app reacts like that because it suddenly sees no more cookies
ajay mali
you are always post great content that really helps a lot to everyone. thank you so much.
WPBeginner Support
You’re welcome
Administratör
David Cuff
Very helpful. Thank you!
WPBeginner Support
You’re welcome
Administratör
ibrahim zouadi
Thank you for sharing those tips, unfortunately none of them have worked for me. I even uninstalled the whole wordpress plugin. I don’t know what should i do next
WPBeginner Support
For the next step, you would want to take at our article below:
https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Administratör
Anthony
This helped like charm
Many thanks.
WPBeginner Support
You’re welcome
Administratör
PDN Social
This was a lifesaver! We were able to follow step-by-step and avoid a major problem!
Great information!
WPBeginner Support
Glad our guide was helpful
Administratör
Jasmeet Singh
I couldn’t find my wp admin page. It shows
”There has been a critical error on your website. Please check your site admin email inbox for instructions.
Learn more about debugging in WordPress.”
How can I fix this error?
WPBeginner Support
For that specific error, you would want to follow our guide below:
https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-wordpress-white-screen-of-death
Administratör
cristi
Hi, i have change by mistake my url and now the domain wp admin login url bring me to other site and i cont have ftp access how i can change back them?
WPBeginner Support
You can either reach out to your hosting provider or if you have phpMyAdmin access you could change the options table and update the URL and address.
Administratör
Ankit
define(’WP_HOME’,’https://www.example.com’);
define(’WP_SITEURL’,’https://www.example.com’);
where do these two lines add in wp-config.php file?
At Last OR At Start?
Please clarify
WPBeginner Support
As we state in the article: paste the code just before the line that says ‘That’s all, stop editing! Happy publishing’.
Administratör
Paek
Thank you so much!!!
Adding the wp-config lines solved it.
Thanks!
WPBeginner Support
You’re welcome
Administratör
Ada
Thank you so much for your post. I’m a newbie with WP. These lines worked for me
define(‘WP_HOME’,’http://example.com’);
define(‘WP_SITEURL’,’http://example.com’);
I also changed the below line from false to true.
define( ’WP_DEBUG’, true );
WPBeginner Support
Glad our recommendation could help, the WP_Debug you should be able to return to false should you want
Administratör
mojo
thank u so much after spending so much time after deleting that .htacces and restart my mac open the website finally thanks for ur time
WPBeginner Support
You’re welcome, glad our recommendations could help
Administratör
Goxi
You safe my life man! Just messed around the login wp admin site if it wasn’t for this tutorial I would never have solved the problem!
WPBeginner Support
Glad our guide was helpful
Administratör
Tomer
Thank you very much for this tutorial!
I have tried these methods and managed to temporarily fix the problem.
The thing is, that after everything seems to be working again, the next day it happens again. Without me changing anything at all. Any tips on that?
WPBeginner Support
You would want to reach out to your hosting provider to ensure there is nothing on their end that could be causing this conflict
Administratör
Sulivan
For those who ended up here an after all steps could’t solve this, check if you changed table prefix. I have changed mines and just figured out that there are some usermeta that stores the old prefix.
WPBeginner Support
Thanks for sharing what was the issue on your site
Administratör
shahin
thank you bro , amazing content and very useful
WPBeginner Support
Glad you like our content
Administratör
Julie
Tks a lot ! You save me !
WPBeginner Support
You’re welcome, glad our guide could help
Administratör
Ann
Thanks a lot to all of you, and specially to Hand: Changing back php version to 7.3 solved this for me!
WPBeginner Support
Glad the recommendations could help you
Administratör
Hand
I had this issue and spent an entire day trying every possible solution mentioned here and elsewhere without any progress. Then I remembered that I had changed the PHP version from 7.3 to 7.4 on my hosting’s control panel (DirectAdmin). Changing back php version to 7.3 solved this for me.
WPBeginner Support
Thanks for sharing the solution that worked for you
Administratör
Jeff
This worked for me.
Joe
I’ve just worked out that PHP 7.4 missed three of the extensions we had installed on PHP 7.3:
php74-php-opcache
php74-php-process
php74-php-soap
As soon as they were enabled and provisioned the wp-admin 404 error disappeared. Hope that helps you to upgrade to 7.4 trouble-free!
Shiv
Hi
I followed this article and in my case i found one plugin was causing this issue.So it found it by renaming each plugin and keep trying the login and once i reached this plugin and renamed it …admin login worked.So…i renamed back rest of the plugins to their original names and keep this once renamed and admin worked and later i sorted my plugin
Thanks
WPBeginner Support
Glad you were able to get your site working and thanks for sharing the method you used for other users with this issue
Administratör
mark
I deleted the htaccess file as instructed, and now I can’t get a login screen at all. No access to my site (404)
WPBeginner Support
To check for the possible issues, you would want to go through the steps in our article here: https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Administratör
Di
Thanks, you’re a life saver. The .htaccess hack worked!
WPBeginner Support
Glad our recommendation could be helpful
Administratör
gho
I owe you one! I used the codes and it’s simply worked. Big thanks wpbeginner!
WPBeginner Support
Glad our guide could help
Administratör
Giang Nguyen
thanks man. Your Update Site URL works!
I tried to manually install piece by piece in my local macbook, to learn how wordpress work, and missing your piece!
The install manual doesn’t really have this kind of info =)
giang
WPBeginner Support
Glad our recommendation could help you
Administratör
Todd
I’ve had this issue before many years ago and I think my fix was the same this time as it was then. After trying many many suggestions above, what finally did it for me was clearing my chrome browsing history. Someone mentioned trying that and not working, but this was not actually offered as a solution so I thought I would post it. Thanks!
WPBeginner Support
Thanks for sharing what worked for you
Administratör
Peter
I was having a login error where my login page keeps refreshing and redirecting me back to the login screen. And for me (I tried all of the above solutions) and none of them worked.
Then I checked the error_log file on my WordPress site and saw that the problem I was having said ”WordPress database error Disk full”
As a result, I went into my wp-config.php file and added the following code to file right above the text line where it says in the file ”* That’s all, stop editing! Happy blogging. */”.
The code I added is:
define(’WP_MEMORY_LIMIT’, ’256M’);
Problem solved.
WPBeginner Support
Thanks for sharing the solution that worked for you
Administratör
Chris
Thanks for this – it worked perfectly and tehe memory limit solved the problem. I was really angry because all other stuff like plugins, themes, .htaccess didn’t work!!!
Greetigs Chris
purushotham
i am not able to login my wordpress admin ,getting 404 error.what should i do to reslove the issue.
WPBeginner Support
For a starting point, you would want to reset your permalinks using: https://www.wpbeginner.com/wp-tutorials/how-to-fix-wordpress-posts-returning-404-error/
If that does not solve the error then you could try the troubleshooting steps in our guide here:
https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/
Administratör
Travis
None of these options worked for me… Turns out to be a hosting issue. Called Network Solutions and they said that because my database was over 300mb I needed to upgrade my database because after 300mb they lock you out…. Upgrading by DB fixed the issue. Who knew….?!
WPBeginner Support
Glad you were able to find the solution to the problem
Administratör
Chris
How did you upgrade the WP database? I think this may be my problem.
WPBeginner Support
You would reach out to your hosting provider and they would let you know if you need more space for your database similar to Travis
Administratör
hamdi
Defining these lines ON TOP OF wp-config.php helped. They don’t help if you put them at the bottom.
define(’WP_HOME’,’http://example.com’);
define(’WP_SITEURL’,’http://example.com’);
WPBeginner Support
It should still work if you place it at the bottom of the wp-config file, there may have been a problem with where you placed it depending on what’s in your specific wp-config file.
Administratör