• Hey,

    Cliffnotes/summary of post: Trying to allow an end-user to disable a plugin without ever going to/accessing the WordPress plugins page.

    I am trying to setup a custom platform (single site WP install) in which end-users effectively don’t have access to plugins – i.e They can’t install/uninstall plugins, access the plugins page etc.

    They will however have the option of installing/activating a pre-defined list of plugins that I set. That part is taken care of without any issues using this popular code:
    https://tgmpluginactivation.com/

    So the process is:

    #1. Go to the install plugins page
    #2. Install and then activate a plugin or plugins.

    Everything up to this point works fine. However, what if I want to allow them to disable a plugin on their site?. Not easy considering they don’t have access to the plugin page.

    Partial solution:

    #1. Copy the individual plugin deactivate link into a custom menu item within that plugins menu folder.
    #2. Clicking on that custom menu link works as it should – i.e it deactivates the plugin.
    #3. The issue is that upon clicking on the link, it takes the end-user to the plugins page which I don’t want – the url for that page is wp-admin/plugins.php?deactivate=true&plugin_status=all&paged=1&s=
    #4. I can revoke the end-users access privileges to the plugins page, but that will just result in a blank screen saying ‘you dont have sufficient privileges… ‘. when they go to deactivate a plugin…

    So… I am wondering if its possible to setup a custom redirect from wp-admin/plugins.php?deactivate=true&plugin_status=all&paged=1&s= to wp-admin/index.php for example?

    Any input would be appreciated…

  • The topic ‘Deactivate a plugin – Redirect to custom link on page reload?’ is closed to new replies.