• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
WP Akuten

WP Akuten

Take it easy - it will be fine

  • Tips
  • Development WordPress
  • Troubleshooting
Boka ett möte
Ring
Sök
  • Tips
  • Development WordPress
  • Troubleshooting

Log in to wordpress when you forgot your password or username

WP Akuten > Troubleshooting > Log in to wordpress when you forgot your password or username

How to hack in

skrivet den 16 January, 2025, uppdaterat den 16 January, 2025 av Karin H Olsson

  1. The most common reason is , of course, using the wrong username or password.

    Solution: Start by requesting a new password at the same URL you normally log in to. Then follow the instructions.
Login wordpress

2. You did not receive an email!

Solution: Check your spam folder. If there is no email there , consider whether you have used the correct username/email address.

3. You cannot find an email despite checking spam and email address.

Now it’s a bit trickier. If you have ssh access to your hosting , list users with the command”wp user list”. Check that you are listed and then change your password. Guide: https://developer.wordpress.org/cli/commands/user/update/

4. You do not have access to ssh and therefore cannot change login that way.

Solution: Create a new user by entering some code. You should add this code to functions.php in your active theme.

ATTENTION! Do not forget to remove the user afterwards.

add_action( 'init', function () {
  
	$username = 'admin';
	$password = 'password';
	$email_address = 'webmaster@mydomain.com';

	if ( ! username_exists( $username ) ) {
		$user_id = wp_create_user( $username, $password, $email_address );
		$user = new WP_User( $user_id );
		$user->set_role( 'administrator' );
	}
	

5. You still can’t log in when using the new user (admin) and password (password)

Now there may be some other explanations. One of them could be a security plugin that locks you out and prevents you from logging in. Most of them give some variant of error message.
Solution: Connect via ssh or a file manager and remove the security plugin.
SSH: wp plugin deactive plugin name
Via ftp or file manager: Locate the folder and delete the folder. It is found as a subfolder in wp-content/plugins.

6. You still can ‘t log in
Solution: Now you need to remove all plugins. Either one by one and check between each or all at once.

I would use them all at once:) Don’t forget to make a note of which plugins you had or better yet rename the the plugins folder so you can move them back when you solve the problems.

There may be other problems like PHP version and such. You should probably ask someone for help in that situation

Karin H Olsson

Jag arbetar med teknisk utveckling i WordPress – framförallt när standardlösningar inte räcker.

Jag har en bakgrund som konstruktör inom realtidssystem (de system som finns i bilar, flygplan m.m.) och har följt utvecklingen hela vägen till dagens moderna webb.

Med utbildning inom både systemvetenskap och psykologi arbetar jag i gränslandet mellan teknik och användning – där systemen inte bara ska fungera, utan också fungera för människor.

→ Läs mer KoBoToLo – Om KoBoToLo en webbyrå i Karlskoga

Previous Post:line breakNeed to roll back an update in WordPress?
Kategori: Troubleshooting

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Sidebar

Today’s words of wisdom.

Economics: the murky science.Thomas Carlyle

Popular

  • Link to phone number website
  • Scroll forever – infinite scroll
  • My images are cut (cropped) – about image…
  • Searching and editing in WordPress
  • Line breaks on the web – absolutely not!

Du hittar mig i Värmland bland skogar, vargar och sjöar


Mail: info@kobotolo.se

Vill du istället att vi kontaktar dig så skicka ett mail så ringer vi upp. Du kan också fylla i vårt kontaktformulär:


Be mig kontakta dig


Maila mig



Tel: 070 – 49 34 191

Onsdagar 9.00 till 10.00 är vår stående hjälptimme. Då ger vi tips och råd per telefon till kunder och icke-kunder. Ingen fråga är fel!

Övrig tid kan vi tyvärr inte ge support per telefon!

Copyright © 2026 · WordPress Akuten · All Rights Reserved

  • English
  • Svenska (Swedish)