Change WordPress URLs Safely – Learn WordPress from a to z

Tutorials 0 lượt xem

The decision to change your WordPress site URL should not be taken lightly. Because domain names help in brand recognition. People are used to a particular domain when it comes to your content.

The following cases occur:

  • Completely moved to a new domain
  • Increase security by adding SSL/HTTPS certificates
  • Move content in subfolders

How to change WordPress URL in all of the above cases:

1. Change the URL in the WordPress dashboard:

WordPress Address  is the main address of the website/blog.

Site Address  is the address where the files on the website’s web hosting can be accessed.

2. Use wp-config.php . file

Paste the following code at the top of the file. Note: correct the URL for your site.

define('WP_HOME','https://hocwordpress.vn/');
define('WP_SITEURL','https://hocwordpress.vn/');
<div>
<span>1</span><span>2</span>
</div>

If these lines are already in the wp-config.php file, you just need to change them.

3. Change WordPress URL using Database

Go to phpMyAdmin and select your website’s database from the list on the left side. Find the table  wp_options .

In this table you will need to enter a new one for the two options  siteurl  and  home  .

All you have to do is select those values ​​and type in new values. Click  Go  to save.

Epilogue

With just the above simple code, you can change your WordPress URL without losing SEO

If you find it interesting, you can follow the  wordpress tips section  to know more new knowledge.

Follow fanpage to receive the latest posts:  Group

Wish you have interesting and interesting knowledge about wordpress!

Bài viết liên quan