The WordPress Contact Form 7 plugin by Takayuki Miyoshi is a simple and fast way to build powerful contact forms for any wordpress website. Sometimes, as developers, we find the need to restrict access to the Contact forms created using Contact Form 7 for a client’s website in an effort to keep them from altering the structure of the forms.
Here is a simple way to remove Contact Form 7 From the WordPress Admin Menu for all users that do not have Admin access to the WordPress dashboard:
/* Remove Contact Form 7 Links from dashboard menu items if not admin */ if (!(current_user_can('administrator'))) { function remove_wpcf7() { remove_menu_page( 'wpcf7' ); } add_action('admin_menu', 'remove_wpcf7'); }
Simply place this bit of code in your functions.php file and you will see the WordPress Contact Form 7 admin menu link disappear for all users other than the admin.
Thanks dude!
You are welcome, hope it helped!
Works like a charm!
Thank you very much!
Works Great! Thanks for the post could not figure it out myself.
Thanks for the tip my friend!
Thank you, worked a charm
You bet, glad you found it useful!
This was great, worked right off the bat. Thanks!