How to consolidate all sitemaps in a multisite network?

WordPress multisite subdomains or suddirectories? I’m not sure if you’re getting the two confused. Multisite subdomains are basically fake subdomains that simply have a CNAME or A-Name record added in the DNS records. That said, and I believe one responder said this, you just need a sitemap for the root domain, and then you’ll have … Read more

How would I use pre_get_posts to query another site for posts in my multisite network?

OK so for reference I ended up actually using switch_to_blog() and restore_current_blog(). I found no references whatever for querying multiple tables (except writing my own JOIN-statements) when followed the source code for the action pre_get_posts. A lot of advice was given to skip restore_current_blog() to save CPU-cycles but when I checked the source code for … Read more

Removing My Sites menu from Admin

You can use remove_submenu_page to remove it. Note that it doesn’t prevent visiting that page if you manually enter the URL. function adjust_the_wp_menu() { $page = remove_submenu_page( ‘index.php’, ‘my-sites.php’ ); } add_action( ‘admin_menu’, ‘adjust_the_wp_menu’, 999 ); Based on the example from remove_submenu_page Codex page.

WordPress Multisite with NGINX, subfolders, and FROM a subfolder

Actually, I solved it thanks to this reference: https://rtcamp.com/wordpress-nginx/tutorials/multisite/subdirectories/in-a-subdirectory/ With the root directory of the installation being “labs” in my case, the final nginx configuration file looks like: # You may add here your # server { # … # } # statements for each of your virtual hosts to this file ## # You … Read more

How do I share plugin settings across WordPress network?

The generic way to do it, is by using the pre_option_{option} https://codex.wordpress.org/Plugin_API/Filter_Reference/pre_option_(option_name) filter to override the “local” settings and use the value being stored in your “main” sub site. something like add_filter( ‘pre_option_the_plugin_option_name’, function () { // Code assumes that “blog” 1 is the main one in which the relevant settings are stored. if (get_current_blog_id() … Read more

On WP Multi sites how many sites…!

The main problem is that you’re using GoDaddy shared hosting to host 60-site multi-site systems and still expecting it to work. GoDaddy shared hosting is not appropriate for this kind of setup. Once you get past the 5-6 sites range, you need a dedicated server for them. Get a better hosting account. Pay for it.

4 single sites VS multisite wordpress

You can use one installation for four (or more) singular sites without multi-site. Just point all domains to the same directory with your WordPress installation. In your wp-config.php set the necessary variables and constants depending on the currently requested host: switch ( $_SERVER[‘HTTP_HOST’] ) { case ‘example.com’: $table_prefix = ‘ecom_’; $table_name=”ecom”; break; case ‘example.net’: $table_prefix … Read more

get_current_blog_id returns 1 in multisite setting

get_current_blog_id() uses the global variable $blog_id as noted at https://codex.wordpress.org/Function_Reference/get_current_blog_id. When I’ve seen this problem before it’s because I’m declaring $blog_id in my PHP code which is overwriting the WordPress global variable that provides the ID of the subsite. Change the variable name of $blog_id and hopefully the function will start returning the correct site … Read more

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