Greyed out URLs on WordPress
We have found similar thread about this issue here on SO but we're not coders or programmers so if anyone could explain step-by-step in idiot-proof layman's terms how to edit these greyed out URLs, it would be super appreciated - thanks! (picture in link)
There are many ways to change the greyed out URL.
Here I have shared all 3 methods for the same.
1) Change WordPress Site URLs from Admin Area
This is the easiest method to change the greyed out URL.
Simply login to your WordPress website and go to Settings » General page. From here you can change WordPress site URLs under the ‘WordPress Address’ and ‘Site Address’ options.
2) Change WordPress Site URLs Using functions.php File
Please follow below path and open functions.php file
go to /wp-content/themes/your-theme-folder/.
Next, you need to add the following code at the bottom:
update_option( 'siteurl', 'https://example.com' );
update_option( 'home', 'https://example.com' );
3) Change WordPress Site URLs Using wp-config.php File
Simply open wp-config.php file from your root directory
You need to add the following code just above the line that says ‘That’s all, stop editing! Happy publishing’.
define( 'WP_HOME', 'https://example.com' );
define( 'WP_SITEURL', 'https://example.com' );
Also, you do with the database but I am not recommended.
Related
I was editing my WordPress dashboard and I made a type in the site url.
This typo is now causing me to be redirected to a nonexistent domain whenever I try to login through the dashboard.
how can I fix this? I currently have FTP access.
I think the issue is you have entered the wrong domain name in the site URL and home URL.
that's why you are not able to access the website.
For this issue, there are two ways.
1) the First Method
Edit wp-config.php
It is possible to set the site URL manually in the wp-config.php file.
Add these two lines to your wp-config.php, where “example.com” is the correct location of your site.
define( 'WP_HOME', 'http://example.com' );
define( 'WP_SITEURL', 'http://example.com' );
This is not necessarily the best fix, it’s just hard-coding the values into the site itself. You won’t be able to edit them on the General settings page anymore when using this method.
2) Second Method
Edit functions.php
If you have access to the site via FTP, then this method will help you quickly get a site back up and running, if you changed those values incorrectly.
FTP to the site, and get a copy of the active theme’s functions.php file. You’re going to edit it in a simple text editor and upload it back to the site.
Add these two lines to the file, immediately after the initial “<?php” line:
update_option( 'siteurl', 'http://example.com' );
update_option( 'home', 'http://example.com' );
Use your own URL instead of example.com, obviously.
Upload the file back to your site, in the same location. FileZilla offers a handy “edit file” function to do all of the above rapidly; if you can use that, do so.
Load the login or admin page a couple of times. The site should come back up.
Important! Do not leave this code in the functions.php file. Remove them after the site is up and running again.
Note: If your theme doesn’t have a functions.php file create a new one with a text editor. Add the <?php tag and the two lines using your own URL instead of example.com:
<?php
update_option( 'siteurl', 'http://example.com' );
update_option( 'home', 'http://example.com' );
Upload this file to your theme directory. Remove the lines or the remove the file after the site is up and running again.
For more details Here I have shared the WordPress org Support Link
If you have access to the database, you can go into PHPMyAdmin, click on wp_options, then search for both home and site_url (or possibly siteurl) and you can change your values there as well. The previous commenter's methods will also work but using functions.php is unnecessary and using wp-config is a temporary fix, in my opinion.
I want to change WordPress Address (URL) and Site Address (URL). after a few experiments unfortunately using wp-admin or even changing it on phpmyadmin wordpress cannot be accessed.
What I have tried:
1. I try to change the URL in the general settings of the wordpress is still redirecting to the old url & page 404 not found.
Then I try in the same config.php it can't be 404
I change it in phpmyadmin (db) in the same wp_option it can't.
Please help, thanks, in advance
I want to change the url as follows:
https://example.com/spm to https://example.com/
There are several ways to do this:-
Edit wp-config.php
It is possible to set the site URL manually in the wp-config.php file.
Add these two lines to your wp-config.php, where example.com is the correct location of your site.
define( 'WP_HOME', 'http://example.com' );
define( 'WP_SITEURL', 'http://example.com' );
OR
Change WordPress URL Directly in Database
In phpMyAdmin, click on your database on the left-hand side. Then scroll down and click on the wp_options table. If your database has a different prefix it might be named slightly different, such as wp56_options.
Thank You everyone, my issue solve finally.
the problem is my wordpress in subfolder on host. so when i want to change for example to root url or something else.
Move the root wordpress to public html
Move the wordpress file to Public html
i'm working on word-press to create eCommerce website and i have face same problem.
i'm working on PC using XAMPP in localhost server. i have create new page in word-press and after that when i have publish the page and then i click on view the page to see the page whose the page look like ,the page show error "object is not found".
also error in menu on website link navigation.
i have already set permalinks as post name.
and now i have search many time on google but i doesn't found any solution.
i'm very feel frustrating.
please help me to find out the solution.
Are the links defined correctly in your database corresponding to your local Wordpress installation?
If yes, maybe FollowSymlinks are disabled and hence your Permalinks are not working correctly.
See the accepted answer from this SO thread:
Wordpress and Xampp not open child pages
Hope this helps.
define('WP_DEBUG', true);
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
define('SAVEQUERIES', true);
ini_set( 'log_errors', 1 );
ini_set( 'error_log', WP_CONTENT_DIR . '/debug.log' );
add these lines in wp-config.php and then visit the page, this will not resolve the error but create a debug file in the wp-content folder so you can have the better idea where the issue is.. :)
How do I update get_stylesheet_directory_uri? Transferring a website and I have already updated the url for the site inside wp-config using:
define('WP_HOME','https://somewebsite.com');
define('WP_SITEURL','https://somewebsite.com');
Still when get_stylesheet_directory_uri is called it is using a previous url, any idea on how to force this to update?
Thanks!
Once you change the site URL using those DEFINE statements, you also need to flush the permalink settings. Just go to wp-admin -> Settings -> Permalinks, and save without making any changes. That should force it to use your new values.
If you have access to the site via FTP, then this method will help you quickly get a site back up and running, if you changed those values incorrectly.
FTP to the site, and get a copy of the active theme's functions.php file. You're going to edit it in a simple text editor and upload it back to the site.
Add these two lines to the file.
update_option( 'siteurl', 'http://example.com' );
update_option( 'home', 'http://example.com' );
Use your own URL instead of example.com, obviously.
Upload the file back to your site, in the same location. FileZilla offers a handy "edit file" function to do all of the above rapidly; if you can use that, do so.
Load the login or admin page a couple of times. The site should come back up.
Another thing that can happen if your site is multilingual is that get_stylesheet_directory_uri is used in a registered string whose translation is still using the previous domain. In that case, search and replace your translations with the new domain.
I changed the address (I think site location) of my wordpress url to a different url. When I did that, I could no longer access the admin page or the wp-login page but I got to the website.
I'm really confused on whats going on, I also tried setting up phpmyadmin (after the fact) and it redirects me to the page I already made.
So basically, how can I get the visual admin page back so I can continue making pages, and how can I get it to where its not showing raw html.
I would take a look here and follow one of the steps. I had the same issue with my site and editing the fuctions.php file resolved this.
The two main fixes usually are:
Edit WP-Config.php
define('WP_HOME','http://example.com');
define('WP_HOME','http://example.com');
Add these two lines to your wp-config.php, where "example.com" is the correct location of your site
Edit Functions.php
update_option( 'siteurl', 'http://example.com' );
update_option( 'home', 'http://example.com' );
Add these two lines to the file, immediately after the initial <?php line.