Although it might sound like a nonsense at first, as WordPress was originally built as a blogging platform, there are folks who actually doesn’t want to publish at all. Regardless of WordPress theme you are using, it can easily become a simple WordPress theme without blog.
WordPress without a blog, really?
Yes, the idea to write this blog post came to mind when one of the customers using our theme recently asked about the possibility to remove blog from his website completely. It sounded strange at first, but then it totally started to make sense.
The truth is, people are using WordPress not only for what it is intended to be used for. Sometimes they want really simple presentation, non blog website, with only a few “static” pages including about me, services, contact etc.. No news, no opinions, no new age lifestyle advice from experts, no…you name it.
Non blog WordPress website – the solution
All right, the easiest way to achieve this is by simply not publishing any post on the website, how clever?
But (unfortunately or not) WordPress expects you to write and publish. There are a couple of things in the background which are happening whether you are writing or not. Of course, main benefit of getting rid of those things is to prevent WordPress hurting your SEO by generating default blog pages and archives you might not need.
You can tell WordPress and Google that you actually want a website with pages only. Just by adding this simple code snippet into your theme or a child theme functions.php file:
1 2 3 4 5 6 7 8 9 10 11 | /* Register template redirect action callback */ add_action('template_redirect', 'meks_remove_blog'); /* Remove blog */ function meks_remove_blog(){ //If we are on archive template, single post template or index if( is_archive() || is_single() || is_home() ) { global $wp_query; $wp_query->set_404(); //set to 404 not found page } } |
That’s it, now each time Google crawls any of default archive or blog pages, it gets not found 404 page. This way you make sure Google indexes only the pages you are actually using, no bloats, no duplicates.