How many databases do I need?

Multiple installs can share a single database, as long as each install has a unique table prefix defined in wp-config.php before going through the install process: /** * WordPress Database Table prefix. * * You can have multiple installations in one database if you give each a unique * prefix. Only numbers, letters, and underscores … Read more

Generate HTTPS Urls in multisite

Instead of get_option, use home_url which will determine … the appropriate protocol, “https” if is_ssl() and “http” otherwise. If the $scheme argument is “http” or “https” the is_ssl() check is overridden. In fact, network_home_url would be more appropriate since you are talking about Multisite. Those should return the same value that you are trying the … Read more

MultiSite: new Sites not showing up

It appears your sites are not under the same network, and you have network 1 and network 3. Normally this would never happen on an average multisite unless plugins are installed that can change this. Yes 1 WordPress multisite instance can run multiple networks of blogs, you have accidentally stumbled onto this feature, wordpress.com being … Read more

How to Deny Access to No Referrer Requests on Multiste with Mapped domains

You could hook intop pre_comment_on_post: add_action( ‘pre_comment_on_post’, function(){ if ( empty ( $_SERVER[‘HTTP_REFERER’] ) ) exit; }); But … be aware, not all requests without an referer are actually spam posts. Some firewalls and proxies strip this field. And most automated spam comes with a Referer field filled with the name of the spammed domain. … Read more

How To Disable Add new users On Subsites In Multisite?

To remove the Add Users capability from Administrators (but leave it intact for Super Administrators), you can do this: <?php $role = get_role( ‘administrator’ ); if ( $role->capabilities[‘add_user’] == 1 && ! is_main_site( get_current_blog_id() ) ) { // Because this is saved to the database, we check first // to see if it’s already been … Read more

Limit blogs creation

The signup page has validation hooks. How about something like this? add_filter(‘wpmu_validate_blog_signup’,’set_blog_creation_limit’); function set_blog_creation_limit($result) { $blogs = get_blogs_of_user($result[‘user’]->ID); if (count($blogs) > 2 ) $result[‘errors’]->add(‘blogname’, __(‘You have already registered the maximum amount of blogs!’)); return $result; }

404 on page 2 multisite

Every front end page request on a WordPress site produces a main query. The template that WordPress decides to load is based on the results of that main query (you can see the order that WordPress does these things by looking at the Action Reference page). Despite the fact that you never output the results … Read more