You try to connect like every day to your WordPress administration to add a new post, to update your plugins and check that everything is fine on your site.
But today, impossible to connect! You put your identifiers, you are sure those and no, nothing to do, you are blocked on the login page.
This can manifest itself in two ways: no error message, you have the impression that you have just reloaded the login page; or you see the following error messages displayed :
Error: The username field is empty
Error: The password field is empty
Where does this error come from?
Several causes are possible. It will be appropriate to try to find out which one.
- This may be due to a problem with cookies in your web browser
- Your WordPress installation has a URL issue
- The .htaccess file at the root of your site is corrupted
- A plugin blocks you
- An update between a theme and your WordPress poses a problem
- Your database is full or damaged
We will list what to do in each of these cases.
What can be done to solve this problem?
As you have seen, there are many causes that can cause these problems. There may even be others, but we have tried to list the main ones. We will guide you here, for each of these 6 cases, how to solve this blockage or how to control settings. It is of course up to you to identify the exact cause. This article can therefore give you some clues.
- You have a problem with cookies in your web browser
- Delete cookies from your browser, especially those related to WordPress. To know the procedure to apply, we invite you to consult your Internet browser (Firefox, Opera, Edge, Chrome, Vivaldi…).
- Your WordPress installation has a problem with URLs
- Connect by FTP(s) to your site
- Identify the file wp-config.php
- Check and if necessary correct these two lines:
define('WP_HOME','https://www.example.com');
define('WP_SITEURL','https://www.example.com');
You have understood that the URLs must correspond to your domain.
- The .htaccess file at the root of your site is corrupted
- Connect by FTP(s) to your site
- Save the .htaccess file located at the root of your site.
- Delete the copy on your FTP server.
- If the .htaccess file was indeed the cause of your problems, regenerate this file by going to “Settings” – “Permalinks” and simply save the settings.
- A plugin blocks your WordPress
- If you have the ability to access your database
- Disable plugins on your site
- Connect to your database
- If necessary, temporarily, you can upload a phpMyAdmin via (S)FTP on your site https://www.phpmyadmin.net/downloads/
- Go to the wp-options table
- Identify the option_value field and look at the rows that contain active_plugins. Tip: to isolate the rows we are looking for, you can run this query : SELECT *FROM wp_options WHERE option_name = ‘active_plugins’;
- For each of the plugins of your site, replace in the value a:1:{} by a:0:{}
- Disable plugins on your site
- If you have the ability to access your database
- You have a problem with a theme following an update:
- If you don’t have access to your database
- Set the default theme
- Connect to your site using (S)FTP
- Go to /wp-content/themes/ and change the name of the folder that contains your current theme. WordPress will then use the default theme (or you can download it: https://wordpress.org/themes/twentynineteen/ and drop it on your server in the same folder of themes)
- Set the default theme
- If you don’t have access to your database
- Your database is full or damaged
- A rarer case but one that deserves attention. If you have access to your hosting, observe the size of your database.
If it is abnormally huge, you may be a victim of hacking. - If the size seems correct to you, look at some of the tables in your base and check if everything is OK. If not, correct any errors if you can. Remember to save your database before.
- If you are convinced that it is one of these two causes and that you cannot correct an error or that there are too many errors, then the only possibility is to restore a backup. If you don’t have one, contact your web host when you have one. After restoring the backup, you will need to determine the cause of the problem. The intervention of an expert may be necessary to prevent the problem from occurring again.
- A rarer case but one that deserves attention. If you have access to your hosting, observe the size of your database.
Still stuck ? You can contact an expert.