Cannot get eNewsletter to stop appearing in member sites

I Network Activated eNewsletter originally, then thought better of it and deactivated and just locally activated it on my main site. I use Exclude Plugins to stop those plugins I don't want appearing in member admins to not appear and it seems to work with everything except eNewsletter.

In fact, I deactivated it altogether on the main site and it still appears in member admins. Is it specifically required by something else I may have turned on, or am I missing something?

With the PHP send option this could become a dangerous spamming tool in the wrong hands. Is my only option to delete it altogether, which would be a shame as I've got it working nicely using SMTP.

  • Dharmendra

    Hello @devex,

    I hope you are well today!

    You can add below mentioned custom code in your functions.php in the theme, if you think your theme won’t be changed. Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name 'mu-plugins'. If there is no folder in that name, then create a folder, name it 'mu-plugins', create a file inside that, give any name you like and paste the code in there. You don't need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always. If you use mu-plugins then add a PHP start tag at the beginning of the code.

    if ( !is_super_admin() ) {
    	add_action( 'admin_init', 'remove_email_newsletter_menu' );
    }
    
    function remove_email_newsletter_menu() {
    	remove_menu_page('newsletters-dashboard');
    }

    The above code will hide e-newsletter menu for users other than super admin.

    Hope it helps :slight_smile: Please feel free to ask more question if you have.

    Have a great day! :slight_smile:

  • devex

    Thanks for the input Dharmendra but I went the mu-plugins route, added the opening <?php etc. copied the code exactly (yes, I avoided the '&#039' error before asking) and all I get now is an HTTP 500 Internal Server Error for the whole site. Removing the file and everything's OK again.

    Not sure on your 'adding to a template option' as it's an admin thing, not a site template issue.

    Did you test this code?

  • aristath

    Hello there @devex, I hope you're well today!

    Where exactly is the e-newsletter plugin installed?
    Is it on your wp-content/plugins folder, or on mu-plugins?
    Have you network-activated it or activated it on a single site?
    Could you please grant me access to your backend so that I may see exactly what is happening?
    To do so, from your dashboard go to WPMUDEV => Support => Support Access and click on the "Grant access" button.

    Cheers,
    Ari.

  • devex

    The code I've used is:-

    <?php
    if ( !is_super_admin() ) {
    	add_action( 'admin_init', 'remove_email_newsletter_menu' );
    }
    
    function remove_email_newsletter_menu() {
    	remove_menu_page('newsletters-dashboard');
    }

    in a file called enewsletter-additional.php

    The file was in mu-plugins whilst the enewsletter plugin was in the usual plugins directory. I've tried moving the enewsletter plugin to mu-plugins and that makes the function disappear altogether, regardless of the additional file! Similarly moving both the plugin and the additional file to the plugins directory just has enewsletter appearing again as a function with the additional file doing nothing.

    Reading my initial question you'll know that eNewsletter is NOT Network Activated and it's appearance in child site side menus is regardless of whether it's included under Exclude Plugins or not. or whether it's activated on the main site or not.

  • devex

    Now that is bizarre - I have two sub sites faq and faq2. The Administrator chrisedit is only listed in faq but logging into faq2 using those details took me to faq/wp-admin and eNewsletter isn't listed but did appear in the side menu, hence my comment!

    Anyway, everything now seems to have reset. I don't know whether having Super Admin open in one browser and Admin in another had something to do with it, but we now seem to be where we should be. Thank you.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.