Skip Navigation

[Resolved] Need to hide button for backend FIELDS and VIEWS for all. Solutions don’t work.

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to hide the Fields and Views button from all Users in wp-admin, because we do not use it. The code solutions I have found so far in the forums are not working.

Solution:
You'll need to add some custom CSS:

/* WP Tools button above wysiwyg editor classic */
.js-wpv-fields-and-views-in-toolbar { display: none !important;}
#qt_content_wpv_conditional { display: none !important; }
#qt_content_bs_component_show_hide_button { display: none !important; }

Apply that custom CSS in a separate admin-style.css file, and enqueue it in your child theme's functions.php file like this:

function load_custom_wp_admin_style() {
        wp_register_style( 'custom_wp_admin_css', get_stylesheet_directory_uri() . '/admin-style.css', false, '1.0.0' );
        wp_enqueue_style( 'custom_wp_admin_css' );
}
add_action( 'admin_enqueue_scripts', 'load_custom_wp_admin_style' );

Relevant Documentation:
https://codex.wordpress.org/Plugin_API/Action_Reference/admin_enqueue_scripts

This support ticket is created 5 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by Julie Duran 5 years, 3 months ago.

Assisted by: Christian Cox.

Author
Posts
#1180127

I am trying to: hide FIELDS and VIEWS button above wysiwyg

Link to a page where the issue can be seen: hidden link

I expected to see: Button hidden

Instead, I got: Button displays

NOTE - I've just upgraded to WordPress Gutenburg BUT HAVE INSTALLED AND ACTIVATED The CLASSIC editor.
I've tried many of the suggested solutions and the button still appears for all roles. I've last tried adding custom.css below and that didn't hide the button. I want to hide it from ALL roles. We don't use it.

/* WP Tools button above wysiwyg editor classic */
.js-wpv-fields-and-views-in-toolbar { display: none !important;}
#qt_content_wpv_conditional { display: none !important; }
#qt_content_bs_component_show_hide_button { display: none !important; }

#1180192

I've tried many of the suggested solutions and the button still appears for all roles. I've last tried adding custom.css below and that didn't hide the button.
It looks like you added this code directly in your child theme's style.css file:
hidden link

However, the theme's style.css file is not loaded in admin, so this CSS isn't being applied to the admin interface. In addition to the style.css file, you can copy those 3 lines of CSS into a separate admin-style.css file and enqueue that file in your child theme's functions.php file like this:

function load_custom_wp_admin_style() {
        wp_register_style( 'custom_wp_admin_css', get_stylesheet_directory_uri() . '/admin-style.css', false, '1.0.0' );
        wp_enqueue_style( 'custom_wp_admin_css' );
}
add_action( 'admin_enqueue_scripts', 'load_custom_wp_admin_style' );
#1180224

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.