[wp-trac] [WordPress Trac] #57269: In multisite, get site URL from config instead of the database (was: Force WordPress to get it's siteurl from config not from the databes)

WordPress Trac noreply at wordpress.org
Sat Dec 3 20:03:19 UTC 2022


#57269: In multisite, get site URL from config instead of the database
-------------------------------+------------------------------
 Reporter:  mhmdyassin07       |       Owner:  (none)
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Upgrade/Install    |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  close 2nd-opinion  |     Focuses:  multisite
-------------------------------+------------------------------
Changes (by sabernhardt):

 * keywords:   => close 2nd-opinion
 * focuses:  multisite, performance => multisite
 * component:  Database => Upgrade/Install


Old description:

> a big problem is facing everyone trying to move a site between two
> hosting or between two environments like (staging and production )
> the most frequent problem is the site URL and the internal links
> and if you have extensive databases it will be your nightmare
> so it creates issues and limits our flexibility
>
> so what I suggest is to set the site and home URLs from the wp-config.php
> file
> like
> define( 'SITEURL', 'https://mywebsite.com' );
>
> I know it is not very simple, especially with multi-sites but it deserves
>
> I also tried
> define( 'WP_HOME', 'http://example.com' );
> define( 'WP_SITEURL', 'http://example.com' );
>
> but if you don't have 'siteurl' option on your site it will give you
> 'Error establishing a database connection in the front end
> and
> 'One or more database tables are unavailable. The database may need to be
> repaired.'
>
> which even not the clear error message
> die to
> wp-includes/functions.php => function is_blog_installed
>

> I can work on this point but before I spend time, I need approval from
> the WordPress team that they will accept such modification or that not be
> accepted

New description:

 a big problem is facing everyone trying to move a site between two hosting
 or between two environments like (staging and production )
 the most frequent problem is the site URL and the internal links
 and if you have extensive databases it will be your nightmare
 so it creates issues and limits our flexibility

 so what I suggest is to set the site and home URLs from the wp-config.php
 file
 like
 `define( 'SITEURL', 'https://mywebsite.com' );`

 I know it is not very simple, especially with multi-sites but it deserves

 I also tried
 {{{
 define( 'WP_HOME', 'http://example.com' );
 define( 'WP_SITEURL', 'http://example.com' );
 }}}

 but if you don't have 'siteurl' option on your site it will give you
 'Error establishing a database connection' in the front end
 and
 'One or more database tables are unavailable. The database may need to be
 repaired.'

 which even not the clear error message
 die to
 `wp-includes/functions.php => function is_blog_installed`


 I can work on this point but before I spend time, I need approval from the
 WordPress team that they will accept such modification or that not be
 accepted

--

Comment:

 Hi and thanks for the report!

 I think this is the same issue as #55607 and very similar to #33909. We
 probably should close this ticket as a duplicate of one of those.

 Changeset [14517] intentionally removed URL filters in multisite to
 correct the admin URL, and reinstating them probably could break other
 things now.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57269#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list