Wrong wp-admin URL

Eventually, I found the reason of this weird behaviour. It is caused by the JavaScript embedded in wp_admin_canonical_url() (https://developer.wordpress.org/reference/functions/wp_admin_canonical_url/) The URL is determined by this piece of code $_SERVER[‘HTTP_HOST’] . $_SERVER[‘REQUEST_URI’] where the latter one returns wp-admin instead of hello/wp-admin. By manipulating the value in $_SERVER[‘REQUEST_URI’], I can successfully get the correct behaviour in admin … Read more

When clicking on “home” page from any other page, it goes to IP address and my website doesn’t load

The URLs are greyed out in the Settings page because of the entries in the wp-config.php file. If there are entries for these values, those values override the values in the wp-options table, and the override makes the Settings values uneditable. See this in the Codex: https://wordpress.org/support/article/changing-the-site-url/ It is possible to set the site URL … Read more

How to set “Site Address (URL)” programmatically on WP multisite?

If you just want to update that one value, then you can use wp_update_site(): wp_update_site( 123, [ ‘domain’ => ‘new-slug.domain.com’, ] ); But to really update the site URL/address, you’d need to update both the siteurl and home options for the site: switch_to_blog( 123 ); update_option( ‘siteurl’, ‘new URL here’ ); update_option( ‘home’, ‘new URL … Read more

How to Create a Staging Site / Changing URL

In your new site, change the value of siteurl. It should be in the first row of the options table in the database. Then you should be able to access wp-admin on the new site. Then install this plugin: Better Search Replace.

Override WordPress theme url

In a comment I pointed you to an existing answer that I figured would solve your problem. You replied thanks for answering. but it is working for bloginfo(‘url’) & not for bloginfo(‘template_url’). Any ideas? The answer I pointed you to is easily adaptable for that: In your wp-config.php file, after (!) require_once ABSPATH . ‘wp-settings.php’; … Read more

Hard code a domain into Yoast SEO canonical URLs

Below is a small plugin using which you should be able to replace the domain for canonical url to another domain. <?php /* * Plugin Name: WPSE WPSEO Canonical * Plugin URI: http://wordpress.stackexchange.com * Description: Changes canonical url domain. * Author: Sisir * Version: 1.0 * Author URI: http://developerpage.net * **/ add_filter(‘wpseo_canonical’, ‘swpseo_canonical_domain_replace’); function swpseo_canonical_domain_replace($url){ … Read more

I don’t see site_url and home_url fields in wp_options table (phpMyAdmin)?

Check wp-config.php. It’s possible to define these values there, in which case they won’t be available as settings, which means they won’t be saved in the database. 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 … Read more

Remove / from www.example.com/ [closed]

This isn’t a WordPress thing, this is a browser/HTTP thing. Firefox may be showing the / as part of a setting, but example.com and example.com/ are the same URL. This Q on webmasters goes into more detail as to why this is the case: https://webmasters.stackexchange.com/questions/35643/is-trailing-slash-automagically-added-on-click-of-home-page-url-in-browser

Putting my site live

This question has been asked many many times before. Here’s the Codex: http://codex.wordpress.org/Changing_The_Site_URL The easiest thing to do is add a couple of lines to your wp-config.php define(‘WP_HOME’,’http://example.com’); define(‘WP_SITEURL’,’http://example.com’);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)