How to fix WordPress login issues

WordPress login issues, such as the page refreshing and redirecting when you try to access the site, are commonly caused by problems with the permalink structure, your .htaccess file or an improperly configured Site URL. A plugin or your theme files may also introduce configuration issues.

In this article, we’ll walk you through the steps to troubleshoot WordPress login issues.

Clear your browser cache and cookies

Like many web platforms, WordPress uses cookies for user authentication. Start troubleshooting by clearing your browser cookies and cache. Check that your browser has cookies enabled – disabling cookies will prevent you from logging in. Restart your browser and then try to log in again.

Deactivate and reactivate your plugins

If clearing your cache and cookies didn’t solve the problem, the next step is to find out if a specific plugin is creating the issue. The simplest way to do this is to deactivate all of your plugins, then reactivate them one at a time until you notice the problem reoccur.

If you still experience the issue when all of your plugins are deactivated, move on to the next step.

You can deactivate your plugins in one procedure using an FTP client or cPanel File Manager with the following steps.

  1. Navigate to the app folder in your main WordPress folder.

cPanel File Manager

2. Right-click on the plugins folder and select Rename.

Rename Menu

3. Rename the file to something like plugins.old – any name will do, as long as it’s different from the original. This step will automatically deactivate all of your plugins, and you should now be able to access your WordPress admin dashboard.

4. Once you have logged in, go back to your /app/ folder and create a new plugins folder. 

5. Copy each plugin, one at a time, from plugins.old into the new folder and, in the WordPress admin dashboard, try to activate. When you hit the error once again, you will have identified the problem plugin.

Revert to the default theme

If the previous two steps do not solve the WordPress login issue, there may be an issue with your site theme. Themes can include misbehaving code that can cause logins to fail. You can switch to a default theme or another installed theme by editing the WordPress database.

  1. Log in to your HostPapa Dashboard.
  2. In the top navigation menu, select My cPanel.

My cPanel Menu

3. Click the phpMyAdmin icon, found under Databases.

phpMyAdmin

4. In phpMyAdmin, select your WordPress database from the list in the left sidebar.

6. A list of database tables will be displayed. Select the table called [yourprefix]_options (in the example above, it’s wpjq_options, but your prefix will be different).

Display options

6. At the top of the page, click the Number of rows dropdown menu and select 500 to expose the complete list of database records. 

7. When the screen updates, scroll down the list of options until you find Template and stylesheet.

Theme options

8. In the example above, both are set to Avada, which is the name of the theme currently active on the site. Click the Edit button for both records and enter the name of another theme you have installed on the site. Common WordPress default themes include Twenty Seventeen (enter twentyseventeen for the option_value), Twenty Sixteen (twentysixteen) and so on.

Editing records

9. Click the Go button to save your changes and ensure you have amended both the Template and stylesheet records.

10. Try to log in to your WordPress administration dashboard. If the issue is resolved, you should contact the theme author to report the problem.

Regenerate your .htaccess file

.htaccess is a configuration file used by the Apache webserver that can control access to resources on your server. Your .htaccess rules may become corrupted or inadvertently changed by a plugin, resulting in login issues. Regenerating the .htaccess file can resolve these issues.

  1. Log in to your HostPapa Dashboard.
  2. In the top navigation menu, select My cPanel.

My cPanel Menu

3. Select File Manager.

cPanel

4. At the top right of the screen, click the Settings button.

cPanel File Manager Settings

5. .htaccess files are hidden from view by default. To expose them, make sure Show Hidden Files (dotfiles) is checked in the Preferences panel, then click Save.

Show Hidden Files option

6. Navigate to your website root using the left sidebar. 

7. Right-click on the .htaccess file and rename it. The file may contain important rules that you wish to keep for plugins and other supporting services, so it’s important to rename it rather than delete it.

.htaccess file listing

8. Try to log in to WordPress once again. If you succeed, your .htaccess rules were indeed preventing site access. Once logged in, head to Settings > Permalinks and click Save. This will generate a new .htaccess file on your server.

Make sure to copy any other rules you need from the old version of .htaccess to the newly-generated version. Simply open the old file in cPanel File Manager, copy the rules you need, then open the new version of the file and paste them in. Save the updated .htaccess file to proceed.

Check your site URL

If you’ve recently changed your site domain settings, it’s well worth checking the WordPress Site URL. To do so, use an FTP client or cPanel File Manager to edit your wp-config.php file. Add these two lines of code  (if they don’t exist), changing www.mysite.com (or mysite.com) with your domain name.

define('WP_HOME','https://www.mysite.com');

define('WP_SITEURL','https://www.mysite.com');

Save the file and try to log in to WordPress once again.

If you need help with your HostPapa account, please open a support ticket from your dashboard.

Related Articles

Get online with our affordable web hosting

Get online with our affordable web hosting

Learn more now
HostPapa Mustache