Schedule a Free Consultation

Multisite Create Page on All Sites

Read Article

Have you ever worked on a multisite with 60+ sites?

For projects of this size the deployment is a challenge in itself because you might need to:

  • regenerate the thumbnails on all the 60 sites; Of course, doing it manually is a no go
  • configure a certain page as homepage on all 60 sites
  • if you are working with a preset theme (as we were asked to do), how do you configure 5-10 theme settings on all 60 sites in a humanly reasonable way?
  • create a page with a given slug and template on all sites in a multisite install

Recently we had a project of this magnitude for TiE Global. To streamline the deployment, we wrote a few plugins that handle the deployment automation task for us. And because we’ve received so much from the open source community, we are paying it forward by publishing one of our plugins.

WPRiders Multisite Create pages plugin handles the following tasks:

  1. Create/update a page on all sites of a multisite install
  2. Optionally, set page slug
  3. Optionally, set the template of the page
  4. Optionally, set page as home
  5. Optionally, set page as blog

Multisite install add page and configure options

In case you are interested in how this plugin works, here are a few snippets together with technical explanations.

Create/update a page on all sites of a multisite install and set the slug

The create/update page script might timeout due to large number of websites. To avoid using php “set_time_limit” or other server settings we use ajax to execute each site update on a separate request:

Optionally, set the template of the page on all sites of a multisite

After the page has been created, one might want to actually set a template for that page across all the sites. Here’s how we do it. The code is adapted from the WordPress wp-admin back-end page editor. The same snippet sets the page as a blog page on all sites:

Full plugin code

The full source code of the working plugin can be downloaded from here.

Enjoy 🙂

 

Navigate to

Check some other articles we wrote

How to Choose a WordPress Ongoing Development Agency
Only someone that hasn't run a business website seriously still considers that the work is done when the website is finished. Most of the time, that's actually when the complex work starts. We recommend you hire a WordPress ongoing development agency that will take care of this, giving you the peace of mind and time to run a business.
What Can You Build With WordPress?
In today’s world, having a business and no website is like trying to drive a car with no engine. Sure, you can reach your destination if you get out and push your car, but wouldn’t it be a lot easier if you just had the engine in the first place? We can say the same […]
Top 10 Reasons to Use a WordPress Maintenance Service
In the following article, you will learn the top 10 reasons you should use a WordPress Maintenance Service for your website if you are serious about your online business. WordPress started as a blogging platform and did a phenomenal transition to an excellent CMS, which now, according to W3Techs, powers 43% of all online websites […]