This happens because, at the time of installing WordPress, the current path is stored in the database.
To modify the paths of our installation, we must manage the WordPress database as follows.
Select the database of your installation. If you only have one database, it will be automatically selected:
Enter the "wp_options" table:
Edit the "siteurl" field. It is usually located on page 1 with the value (column "option_id") 1 or 3:
Also edit the "home" field. It is usually located on page 1 with the value (column "option_id") 1 or 2:
Once the changes are made, save them.
In some cases, images in the "uploads" folder may not be indexed correctly. If they do not display properly, you can install the "Better Search and Replace" plugin or Duplicator to correct the image paths.
It is possible that after making the changes, the website still appears the same. This is because you are viewing cached content stored in your browser. To fix this, you only need to clear your browser cache .
The easiest way to do this is by pressing the keys "Ctrl+F5" simultaneously. This should allow you to view the website correctly.