1

I would like to remove the edit option for all plugins on a wordpress site. Is there a hook/filter for doing this? It would be preferred to do it from the theme's functions file, rather than try to disable it within each plugin. Ideally, it could be removed for users without admin privileges, but that is a secondary concern.

enter image description here

1 Answer 1

4

Add the following line to your WordPress installs wp-config.php

define('DISALLOW_FILE_EDIT',true);
3
  • That did it! Awesome. However, due to the version control setup we have, I would still prefer to do it within the theme functions. And the good news is, you can put this code there instead, and it still works! Merci!
    – Starfs
    May 11, 2012 at 14:49
  • Yup, you can set wordpress constants elsewhere as well. wp-config.php simply is the default location where you'd do so. If within the theme seems to be a better fit for your case, I don't see why you shouldn't set it there. You can wrap it in conditionals (user role) there as well. May 11, 2012 at 14:52
  • Can I do this for one particular plugin...
    – ReNiSh AR
    Oct 16, 2017 at 9:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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