Prem Tiwari - - WordPress, WordPress Beginners, WordPress Snippets
If you want to remove the Visual and Text switch tabs from your default WordPress editor, then keep your close eye in this tutorial as I am going to share the simple WordPress tricks to remove the visual tabs.
Copy the below code and paste it inside the functions.php file from your current activated theme’s folder.
1 2 3 4 | //remove the visual & text tab options add_filter( 'user_can_richedit' , '__return_false', 50 ); |
We have used to hide the editor tabs easily with the help of CSS. We’ll output some CSS to the admin’s head to do that. Below code will hide the visual tab option from the new post page. If you want to hide it for the page as well, then add your conditions in below if statement.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | function hide_editor_tabs() { global $pagenow; // Only output the CSS if we're on the edit post or add new post screens. if ( ! ( 'post.php' == $pagenow || 'post-new.php' == $pagenow ) ) { return; } ?> <style> .wp-editor-tabs { display: none; } </style> <?php } add_action( 'admin_head', 'hide_editor_tabs' ); |
Hope this tutorial helps you. Please do you like & share this tutorial with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool WordPress tutorials.
Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies. View all posts by Prem Tiwari
Tags: how to remove visual tabs from the editor., remove visual tab default editor, remove visual tab from default editor, wordpress default editors