Don’t Let Your Plugin Be Activated on Incompatible Sites

When you write a WordPress plugin, you can specify a minimum WordPress version that your code is compatible with, using the “Requires” option in your plugin header, but it isn’t enforced. Along with that, there’s no way to specify a minimum version of PHP or MySQL.

This can cause your users to have bad experiences with your plugin, and you’ll get bad ratings.

So, here’s how I make sure my plugins are only activated when I want them to be.


It’s only a little extra code when added to a plugin, provides complete protection, and won’t cause any weirdness on the front end of your site, it’ll just deactivate itself either on activation, or when someone visits wp-admin.

4 replies on “Don’t Let Your Plugin Be Activated on Incompatible Sites”

  1. Hi,

    You have this Wp pluggin name ‘Job Manager’ does it have this code?

    It’s labeled as ‘Requires: 2.9 or higher’.

    A friend of mine installed it and he told me it was working perfect; recently after he gave the site to his client, the site stoped to show the information for every job entry.

    I told him he was using a newer version of WP but I wanted to ask you just to make sure that’s what’s causing he’s troubles since he told me in the beginning everything was fine.

    Regards from C.R


  2. Pingback: Enrique's Thoughts

Comments are closed.