WordPress Disable Sidebars

My blog was started back in 2006 with WordPress and over time the categories have gotten crazy out of hand. I write about the shows I work on, my original productions, science, religion, software and everything in between. It’s bad practice from an SEO standpoint and bad for focused business marketing, but it’s my personal blog so it is what it is.

Most people that visit my website come here through the “back door” by going to a specific article I’ve written. So two things became very apparent:
1 – Most traffic comes to a specific article because they have interest in that particular content.
2 – Industry people (usually music, theatre and entertainment) come to the front page to check me out.

The first group of people don’t really care who I am (I think) because they are just interested in the niche information of the specific article. The second group doesn’t care about my blog (I think) because they want to see what I’ve done and how well I would fit into their team.

So with that in mind I’m making some fairly simple changes to improve traffic on the blog to lead it back toward my front page and to revamp the front of my website to appeal to entertainment industry people.

Part of all this is to disable sidebars on my blog. My blog sidebar is a messy jungle of unrelated categories that has taken over like a wild weed since 2006. I wanted to disable sidebars for ALL individual WordPress posts and keep it only on the front page of my blog. (To see how many unwieldy categories I have visit the front of this blog or my sitemap at https://conradaskland.com/blog/sitemap.xml

There are WP widgets that will allow you to disable sidebars on single pages or single posts but I wanted to disable on all posts at once. So, here is the code to hide/disable your WordPress sidebars on all posts:

Disable or hide your WordPress sidebar on your blog post pages editing the single.php file from your theme (or the index.php file if your theme doesn’t include the single.php file) and find this snippet of code:

<?php get_sidebar(); ?>

and replace it with:

<?php if(!is_single()) {   get_sidebar(); } ?>

That’s it and your sidebar will now show on all blog pages except the single post pages.

Leave a Reply

Your email address will not be published. Required fields are marked *