Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm currently using WordPress for a website and it will simply be acting as a CMS rather than a blogging platform. This means that WordPress' 'posts' are not needed. Is there anyway of disabling them by adding some code to functions.php?

It would be acceptable to just remove the 'posts' option from wp-admin.

share|improve this question
1  
Simply stop using posts and hide the posts menu? You could use something similar to what i did here. –  t31os Jul 30 '11 at 9:45
add comment

3 Answers

Posts are a broader category than they initially appear to be. The post is any content, even if you're using WP as a CMS. While it might seem like a post is a blog post, really it's anything you post on the site. Disabling it will kill all content. Better to turn off the various bloggy components, such as comments, and then edit the template files to remove references to the author, date posted, etc, to achieve a CMS site.

share|improve this answer
    
This is true from the database perspective, ie everything is stored in the *_posts. However, the API makes a distinction in the form of the post_type. Perhaps a clearer way to ask the question would have been "How do I disable the 'post' post type". Don't know the exact solution but I don't think you can "unregister" it. Your best bet would be to find the hook to disable the default query created for the Loop. –  Hari Karam Singh Jun 6 '12 at 11:53
add comment

Use this Hide admin panels plugin to hide panels.

share|improve this answer
add comment

I don't know if I'm covering everywhere the post functionality is linked from, but adding the following code to functions.php should at least remove the comments links from the administration menu, the toolbar, and the dashboard:

add_action( 'admin_menu', 'remove_admin_menus' );
add_action( 'wp_before_admin_bar_render', 'remove_toolbar_menus' );
add_action( 'wp_dashboard_setup', 'remove_dashboard_widgets' );

function remove_admin_menus() {
    remove_menu_page( 'edit.php' );
}

function remove_toolbar_menus() {
    global $wp_admin_bar;
    $wp_admin_bar->remove_menu( 'new-post' );
}

function remove_dashboard_widgets() {
    global $wp_meta_boxes;
    unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
    unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
}

The only links I can see that are remaining are in the "Right Now" metabox on the dashboard; you can also remove this entire box by adding the following code into the remove_dashboard_widgets function:

unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
share|improve this answer
    
Never unset core vars, if WP change the core var name e.g. from $wp_meta_boxes to $wp_metaboxes, your code won't work anymore. Use remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' ); –  Ralf912 May 3 '13 at 1:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.