How to Solve WordPress Site URL Redirect Loop Problem

Today, I found out that one of my WordPress website has a redirect loop problem. When I try to log into WordPress dashboard, Google Chrome give me the error notice saying this webpage has a redirect loop.

Selection_289

The problem is that I set my site URL and WordPress Address URL beginning with https:// but I recently remove SSL/TLS from Nginx configuration thus creating a redirect loop. Because I am not gonna enable https on my site this time. So I decided to update the site URL and WordPress URL from MariaDB database using SQL statement.

First SSH into Linux Server and then log into MariaDB database.

mysql -u root -p

Enter database root password. After that, show all your databases.

show databases;

Find the database that WordPress using. And select it.

use <database_name>;

Now enter the following SQL select statement

select option_id,option_name,option_value from wp_options where option_id in (1,2);

Outputs

+-----------+-------------+-----------------------+
| option_id | option_name | option_value          |
+-----------+-------------+-----------------------+
| 1         | siteurl     | https://xiaoguoan.com |
| 2         | home        | https://xiaoguoan.com |
+-----------+-------------+-----------------------+
2 rows in set (0.00 sec)

You can see that both siteurl and home (WordPress Address URL) begin with https. So change them so they begin with http. Enter the following SQL statement.

update wp_options set option_value='http://xiaoguoan.com' where option_id in (1,2);

It will update the value of siteurl and home to http://xiaoguoan.com. Now the redirect loop is gone and I can log into WordPress dashboard.

Rate this tutorial
[Total: 3 Average: 5]

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here