{"id":10910,"date":"2025-01-16T10:12:01","date_gmt":"2025-01-16T09:12:01","guid":{"rendered":"https:\/\/wp-akuten.se\/development-wordpress\/log-in-to-wordpress-when-you-forgot-your-password-or-username\/"},"modified":"2025-01-16T10:37:46","modified_gmt":"2025-01-16T09:37:46","slug":"log-in-to-wordpress-when-you-forgot-your-password-or-username","status":"publish","type":"post","link":"https:\/\/wp-akuten.se\/en\/troubleshooting\/log-in-to-wordpress-when-you-forgot-your-password-or-username\/","title":{"rendered":"Log in to wordpress when you forgot your password or username"},"content":{"rendered":"\n<ol class=\"wp-block-list\">\n<li><strong>The most common reason is , of course, using the wrong username or password. <br\/><\/strong><br\/>Solution: Start by requesting a new password at the same URL you normally log in to. Then follow the instructions. <\/li>\n<\/ol>\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"365\" height=\"299\" src=\"https:\/\/wp-akuten.se\/wp-content\/uploads\/2025\/01\/image.png\" alt=\"Login wordpress\" class=\"wp-image-10896\" srcset=\"https:\/\/wp-akuten.se\/wp-content\/uploads\/2025\/01\/image-300x246.png 300w, https:\/\/wp-akuten.se\/wp-content\/uploads\/2025\/01\/image.png 365w\" sizes=\"(max-width: 365px) 100vw, 365px\" \/><\/figure>\n\n<p><strong>2. You did not receive an email!<\/strong><\/p>\n\n<p>Solution: Check your spam folder. If there is no email there , consider whether you have used the correct username\/email address.<\/p>\n\n<p><strong>3. You cannot find an email despite checking spam and email address.<\/strong><\/p>\n\n<p>Now it&#8217;s a bit trickier. If you have ssh access to your hosting , list users with the command&#8221;wp user list&#8221;. Check that you are listed and then change your password. Guide: <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/user\/update\/\" class=\"ek-link\">https:\/\/developer.wordpress.org\/cli\/commands\/user\/update\/<\/a><\/p>\n\n<p><strong>4. You do not have access to ssh and therefore cannot change login that way.<\/strong><\/p>\n\n<p>Solution: Create a new user by entering some code. You should add this code to functions.php in your active theme.<\/p>\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">ATTENTION! Do not forget to remove the user afterwards.<\/mark><\/strong><\/p>\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">add_action( 'init', function () {\n  \n\t$username = 'admin';\n\t$password = 'password';\n\t$email_address = 'webmaster@mydomain.com';\n\n\tif ( ! username_exists( $username ) ) {\n\t\t$user_id = wp_create_user( $username, $password, $email_address );\n\t\t$user = new WP_User( $user_id );\n\t\t$user-&gt;set_role( 'administrator' );\n\t}\n\t<\/pre>\n\n<p><strong>5. You still can&#8217;t log in when using the new user (admin) and password (password)<\/strong><\/p>\n\n<p>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. <br\/>Solution: Connect via ssh or a file manager and remove the security plugin.<br\/><strong>SSH:<\/strong> wp plugin deactive plugin name<br\/><strong>Via ftp or file manager:<\/strong> Locate the folder and delete the folder. It is found as a subfolder in wp-content\/plugins.<\/p>\n\n<p><strong>6. You still can &#8216;t log in<\/strong><br\/>Solution: Now you need to remove all plugins. Either one by one and check between each or all at once. <\/p>\n\n<p>I would use them all at once:) Don&#8217;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.<\/p>\n\n<p>There may be other problems like PHP version and such. You should probably ask someone for help in that situation<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;s a bit trickier. If you have ssh access to your hosting , list &hellip;<\/p>\n","protected":false},"author":3,"featured_media":10908,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[123],"tags":[],"class_list":{"2":"type-post","7":"category-troubleshooting","8":"entry"},"taxonomy_info":{"category":[{"value":123,"label":"Troubleshooting"}]},"featured_image_src_large":["https:\/\/wp-akuten.se\/wp-content\/uploads\/2025\/01\/close-up-of-login-keyboard-tiles-on-a-coral-background-perfect-for-tech-themes.-2882566-1024x681.jpg",800,532,true],"author_info":{"display_name":"Karin H Olsson","author_link":"https:\/\/wp-akuten.se\/en\/author\/wpkarin\/"},"comment_info":0,"category_info":[{"term_id":123,"name":"Troubleshooting","slug":"troubleshooting","term_group":0,"term_taxonomy_id":123,"taxonomy":"category","description":"","parent":0,"count":6,"filter":"raw","meta":[],"cat_ID":123,"category_count":6,"category_description":"","cat_name":"Troubleshooting","category_nicename":"troubleshooting","category_parent":0}],"tag_info":false,"acf":[],"_links":{"self":[{"href":"https:\/\/wp-akuten.se\/en\/wp-json\/wp\/v2\/posts\/10910","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp-akuten.se\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp-akuten.se\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp-akuten.se\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/wp-akuten.se\/en\/wp-json\/wp\/v2\/comments?post=10910"}],"version-history":[{"count":3,"href":"https:\/\/wp-akuten.se\/en\/wp-json\/wp\/v2\/posts\/10910\/revisions"}],"predecessor-version":[{"id":10915,"href":"https:\/\/wp-akuten.se\/en\/wp-json\/wp\/v2\/posts\/10910\/revisions\/10915"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wp-akuten.se\/en\/wp-json\/wp\/v2\/media\/10908"}],"wp:attachment":[{"href":"https:\/\/wp-akuten.se\/en\/wp-json\/wp\/v2\/media?parent=10910"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp-akuten.se\/en\/wp-json\/wp\/v2\/categories?post=10910"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp-akuten.se\/en\/wp-json\/wp\/v2\/tags?post=10910"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}