• Looking for a way to automatically active & deactivate plugins on a set schedule.

    For example, if I want a maintenance mode plugin to automatically activate at midnight, and then automatically deactivate at 8 am, on a daily basis, does anybody have some ideas for how I might accomplish this?

    Is there a plugin for this? Can this be accomplished with css? Is this something a developer could accomplish?

    Any ideas would be much appreciated.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Dion

    (@diondesigns)

    A google search came up with this:

    https://wordpress.stackexchange.com/questions/341339/activate-and-deactivate-plugin-automatically

    If what you want is to set your site in maintenance mode between two set times, then all you need is four lines in your .htaccess file, and optionally a static HTML file to display as the maintenance page. Here’s the four lines, set up to have your site in maintenance mode between midnight and 8AM:

    ErrorDocument 418 "Sorry, the site is in maintenance mode."
    <If "%{TIME_HOUR} -lt 8">
    	Redirect 418 /
    </If>

    If you create a static HTML maintenance page in the same directory as your .htaccess file and name it maintenance.html, change the first line to this:

    ErrorDocument 418 /maintenance.html

    Not tested. The benefit to this, versus using a plugin, is that Apache will block all requests to your WordPress site between the times you select, which will save server resources.

    Thread Starter shizlist

    (@dnacannon)

    Thanks for the reply. The maintenance plugin was just an example. I want to know how to apply a daily schedule to any given plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Automatically Activate/Deactivate Plugin On a Schedule’ is closed to new replies.