Personally, I make them default to the HTTP host:
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
There are no caveats for single WP installs. It’s in fact very convenient when testing changes in a dev.example.com subdomain, in the sense that it allows to use the same database before rolling out a change on a live site.
Don’t do this in multisite installs, however — especially you plan want domain mapping. 🙂
Related Posts:
- How to disable a network enabled plugin for just one site?
- Plugin for editing options on multisite?
- WordPress Multisite: How to make all media library items available for every site?
- How to setup LDAP authentication with WP multisite
- Set default avatar network-wide
- wp-activate.php causing white screen of death
- Change wordpress Multisite default site from side id 1 to side id 2
- How can I have network sites not use year/month folders by default?
- Multisite: Develop locally using production images with .htaccess
- latest 5 posts using switch_to_blog loop
- How to prevent hotlinking with htaccess in WordPress and why most common use about it doesn’t work?
- Why can’t a WordPress network (multisite) in it’s own folder use subdomains?
- restore_current_blog() vs. multiple switch_to_blog() followed by removing $GLOBALS[‘_wp_switched_stack’]
- Display custom homepage text based on domain
- How do I set a default theme in multisite network
- WordPress Multisite Login Access
- Switch_to_blog() outside wordpress
- Jetpack Blog Subscriptions on Multisite [closed]
- Multisite use language code as subdirectory
- How to remove the Tools menu item from the WP-Admin menu
- Sub-subdomain getting redirected to main domain
- Using $wpdb Class to Pull Recent Comments Across a Network
- Default content for a new site in multi site
- WordPress (+WPMU) Import/Export ALL settings?
- wordpress htaccess is hijacking my .mp4 files
- Is there a way to separate a site inside a network (multisite) into its own wp site?
- How to work on a live WPMS blog when domain is unresolved? [closed]
- How do you load WordPress from an external script when using MultiSite? [duplicate]
- Has WP and MU fully merged?
- Why is ‘is_multisite’ returning true when it’s a single install?
- Hook up MU site creation
- Migrate a WP website from a single-server single-domain to a multi-server multi-domain installation
- Forcing SSL Protocol for Multisite Subdomain Child Sites + cPanel Configuration
- Website DR using Multisite
- Fresh Multisite Install – Can’t Log In
- current_user_can() always returns true if user is super admin
- multisite hook for Add Existing User
- Displaying a message upon user registration
- access the plugins for each role in WordPress multisite
- What sites are you registered to when joining a multisite?
- How to redirect one page on the subdomain
- ReWriteRules and WordPress Multi-Sites with Sub Directories
- Is the Multi site functionality a viable option for Country and Language targeting?
- How can i redirect my Blog to a Subdomain?
- WordPress Multisite Redirection Issue
- Multisite user roles – capabilities not working
- WordPress: how to change URL for individual MultiSites?
- Change main site in multisite install?
- Enable “My blogs” in a custom installation
- HTTPS Warning and Certificate Error when Updating Network
- Multisite, with virtual root
- Complex WordPress Website
- Where to set individual blog quotas?
- Create sub-domain for multisite and multi languages?
- How to retrieve Post Excerpt from a different site in the Network
- Changing the language for each individual site in wordpress multisite
- how to have __() translating in languages different from admin?
- How to temporarily redirect front page of a network to one of the sites/blogs?
- Multisite: Redirect to appropriate domain if subdomain doesn’t exist
- How to change a user role after registering in multisite?
- Set a default page template to load for multi-site
- Multisite questions
- Delete user from multisite when removed from subsite
- how to control display switch_to_blog( $subsite->blog_id ); $tags = wp_tag_cloud
- WordPress multisite with domains and subdomains
- Which Multi-language option for WordPress is best from an SEO and Woocommerce perspective?
- Multisite 404 page
- Sort posts according to date
- Creating a multilingual multisite
- Subdomain is not working
- How to automatically create an index of child sites at the root url for a multisite installation?
- Does switch_to_blog support array or other ways to show all posts on a network install?
- How to make subdomain and muti-site but wordpress isn’t in root?
- Show buddypress profile fields in a multsite blog [closed]
- Migration: previous URL redirection after migrating
- Add www to the Root Site in WP Multisite Network
- Multisite problem with unexisting paths to CSS etc
- URLs for (MultiSite) link images are always relative
- How to disable Gutenberg editor from Multisite Admin panel?
- Moving wordpress multisite to new domain
- How to allow mixed case characters in multisite site name?
- Separated Theme file on multi site network in subdomain
- User not staying logged into one of sub sites in multisite after SSL
- Which action hook to update custom field at network/site-info.php in multisite on update site info
- register_setting() for single site vs update_site_option() for mu
- Allow users to register on multisite through WooCommerce using the same email address
- How To Change the URL of a WordPress Multisite
- Sending SMTP mail using a server with self-signed SSL
- Site w/ Addon Domain doesn’t show CSS
- WordPress MU – Creating a site takes ages
- Default sub-pages on WordPress Multisite
- WordPress Multisite – Questions about select all posts from all network sites
- Multi site and media uploader
- There is no featured image in my post in wordpress multisite theme [closed]
- Comment reporting for Multisite
- How to display the most popular posts of all the blogs in a mu setup? [duplicate]
- WordPress MS wp-admin/includes/post.php error with shortcode generator
- Subdomain add comment redirect to 404 not found page iis server
- All links to images are broken in a subdomain multi site environment
- 404 error in dashboard of subdomain of multisite