WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a very rudimentary plugin in development, but at the point of needing to enable the register_activation_hook() and register_deactivation_hook() I have stalled. I am getting zero output from error_log('it ran') debugging statements.

This plugin is going to be run on a multisite install (so I am developing it on a multisite install). I need to create a custom table for the business logic of the work, but until I can get this hook happy I am getting nowhere.

Interestingly, if I Network Activate this same plugin, the site locks me out with a "You do not have permission to access this page." message. I have to clear the wp_sitemeta option: active_network_plugins to get back on the site again.

I'm praying someone hears a bell ringing with this description and ca straighten me out quickly.

share|improve this question
If you would post the code it would be possible for us to evaluate this better, and to test it. – s_ha_dum May 5 '13 at 3:58

I discovered that I was attempting to use register_activation_hook too late in the loading cycle.Moving it outside my class init function to the global scope made it behave as expected.

share|improve this answer
Please use Syntax highlighting and show your complete solution instead of an explanation of it. Thanks. – kaiser Jul 14 '13 at 16:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.