Title: [Plugin: Multiple content blocks] Hiding main content editor
Last modified: August 19, 2016

---

# [Plugin: Multiple content blocks] Hiding main content editor

 *  [RobWatkins](https://wordpress.org/support/users/robwatkins/)
 * (@robwatkins)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-multiple-content-blocks-hiding-main-content-editor/)
 * This is exactly what I was looking for; but is there any way of hiding the main
   content editor?
 * A lot of page type – home pages being a classic example – don’t have an obvious“
   main content” block, and it’d be good to be able to only have the multiple blocks
   showing up when editing these pages.
 * [http://wordpress.org/extend/plugins/multiple-content-blocks/](http://wordpress.org/extend/plugins/multiple-content-blocks/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [rwparris2](https://wordpress.org/support/users/rwparris2/)
 * (@rwparris2)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-multiple-content-blocks-hiding-main-content-editor/#post-1816402)
 * I needed this too.
 * Install this as a separate plugin. I made it so that it hides the main content
   block of a page with the title “Home Page”, but you can change it to whatever
   title you need. There is a small link to re-enable the main content on the fly
   if needed.
 *     ```
       <?php
       /*
       Plugin Name: Hide Main Content Block
       */
   
       function init_hidemaincontent() {
       	add_meta_box('hide_content',__('Hide Main Content Block','cms'),'add_hidecontent_box','page','normal','high');
       }
   
       add_action('admin_init','init_hidemaincontent');
   
       function add_hidecontent_box() {
       	global $post;
   
           if ( esc_attr( htmlspecialchars( $post->post_title ) ) == 'Home Page') {
                   echo "<style type=\"text/css\">#postdivrich{display:none;}</style>";
                   echo "<script language=\"javascript\"> function toggle() {";
                   echo "var ele = document.getElementById(\"postdivrich\"); var text = document.getElementById(\"displayText\");";
                   echo "if(ele.style.display == \"block\") {ele.style.display = \"none\";text.innerHTML = \"show main content area\";}";
                   echo "else {ele.style.display = \"block\"; text.innerHTML = \"hide main content area\";}}</script>";
                   echo '<a id="displayText" href="javascript:toggle();">show main content area</a>';
               }
       }
       ```
   
 *  Thread Starter [RobWatkins](https://wordpress.org/support/users/robwatkins/)
 * (@robwatkins)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-multiple-content-blocks-hiding-main-content-editor/#post-1816404)
 * Brilliant, I’ll give it a go, ta!
 * EDIT: Works perfectly, thanks.
 *  [noahcrem](https://wordpress.org/support/users/noahcrem/)
 * (@noahcrem)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-multiple-content-blocks-hiding-main-content-editor/#post-1816502)
 * Hi rwparris!
 * Any idea how to make the above code work in 3.2.1?
 * I can’t seem to figure out which bit to change to make it work. (or maybe I’m
   missing something?)
 * I get the “Hide Main Content Area” postbox with “show main content area” link
   inside, but the content editor is above it just like normal.
 * Assuming 3.2 changed an admin parameter of some kind, but can’t find it.
 * Thanks in advance! 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Plugin: Multiple content blocks] Hiding main content editor’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/multiple-content-blocks.svg)
 * [Multiple content blocks](https://wordpress.org/plugins/multiple-content-blocks/)
 * [Support Threads](https://wordpress.org/support/plugin/multiple-content-blocks/)
 * [Active Topics](https://wordpress.org/support/plugin/multiple-content-blocks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/multiple-content-blocks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/multiple-content-blocks/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [noahcrem](https://wordpress.org/support/users/noahcrem/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-multiple-content-blocks-hiding-main-content-editor/#post-1816502)
 * Status: not resolved