Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide or disable contact form 7 for specific role in wordpress

I have created a custom user role "faquser" in my wp site. Now I want to hide contact form 7 menu ( or disable) only for this role. How can I do that? I saw this:
http://contactform7.com/restricting-access-to-the-administration-panel/
But if I do this, then contact form only works for administrator and not for any others. I have also tried to do something like this:

remove_menu_page('admin.php?page=wpcf7');

This did not remove the menu item either.

like image 777
Imrul.H Avatar asked Jan 06 '23 10:01

Imrul.H


1 Answers

I found the solution:

remove_menu_page('wpcf7');
like image 126
Imrul.H Avatar answered Mar 19 '23 01:03

Imrul.H