Hide Contact-Form-7 to other users from WordPress Dashboard [updated 2019]
By Default the Contact-Form-7 in the WordPress Dashboard is visible to all the users. You can control this by adding a little code in your wp-config.php
file. There are two options of codes.
- Option 1: Show the contact form but hide the options
- Option 2: Hide the contact form from the WordPress sidebar
Option 1
This option will show the form, so the other use can see the form and its shortcode in the main table. But when they try to access the form a message will display on the page. You are not allowed to edit this contact form.
Copy and paste this code in your wp-config.php
file in your WordPress root directory.
/* Show the form but hide the options - Contact-Form-7 */
define( 'WPCF7_ADMIN_READ_WRITE_CAPABILITY', 'manage_options' );
/* That's all, stop editing! Happy blogging. */
Option 2
To hide the Contact-Form-7 from the WordPress side menubar to other users, Use this code. When the user login into the WordPress dashboard they will not see Contact-Form-7 from the sidebar.
/* Hide the form from the Dashboard - Contact Form 7 */
define( 'WPCF7_ADMIN_READ_CAPABILITY', 'manage_options' );
/* That's all, stop editing! Happy blogging. */
How do you like this article?