How to Remove the Sidebar in WordPress
In this article
Removing the sidebar in WordPress gives your pages or posts a full-width layout, which can make content more readable and give your site a cleaner, more modern look. This guide covers the three main methods: using the Customizer, editing a page template, and adding custom CSS. You’ll need access to your WordPress admin dashboard, and for some methods, a child theme or a custom CSS plugin is recommended to avoid losing changes when the theme updates.
What You'll Need
- WordPress admin access (at least Editor role)
- For CSS method: a child theme or a custom CSS plugin (e.g., “Simple Custom CSS”)
- For template method: a code editor and FTP or file manager access
Step-by-Step
Method 1: Use the Customizer (Easiest)
- Log in to your WordPress admin dashboard.
- Go to Appearance → Customize.
- Look for a section called Layout, Sidebar, or Content Options (the exact name depends on your theme).
- Find a setting like “Sidebar Position” or “Layout” and choose No Sidebar or Full Width.
- Apply the setting to your whole site or to specific pages (if the option is available).
- Click Publish to save changes.
Method 2: Use a Page Template
- Edit the page or post where you want to remove the sidebar.
- In the editor, look for the Page Attributes panel (usually on the right side).
- In the Template dropdown, select a template with “Full Width” or “No Sidebar” in its name (e.g., “Full Width Page”).
- Update or publish the page.
Method 3: Add Custom CSS (Works Everywhere)
- Go to Appearance → Customize → Additional CSS (or use a custom CSS plugin).
- Paste the following CSS code, adjusting the selectors to match your theme’s structure:
/* Hide the sidebar */ #secondary { display: none; } /* Make content full width */ #primary { width: 100%; max-width: 100%; } - Replace
#secondaryand#primarywith your theme’s actual sidebar and content container IDs (use your browser’s inspector to find them). - Click Publish.
Common Mistakes
- Using the wrong CSS selector: Copying CSS without checking your theme’s actual IDs/classes. This results in the sidebar still showing.
- Modifying theme files directly: Editing the
sidebar.phpfile without a child theme. Your changes will be lost when the theme updates. - Not checking all breakpoints: Hiding the sidebar on desktop but forgetting that it might reappear on mobile or tablet.
- Assuming all themes have a “full width” template: Some themes don’t offer one, so you’ll need to use CSS instead.
Tips
- Before making changes, take a backup of your site (files and database).
- Use a child theme for any template edits to ensure updates don’t break your customization.
- Check your site on different screen sizes after removing the sidebar to ensure content looks good.
- If you only want to remove the sidebar on a few pages, use the page template method instead of global CSS.
Troubleshooting
Sidebar still appears after applying CSS: Your theme might use a different selector. Use your browser’s developer tools (right-click on the sidebar → Inspect) to find the correct ID or class. Also, clear your browser cache and any caching plugins.
Content stretches too wide: If the content becomes too wide for readability, set a max-width on the content container in your CSS, e.g., max-width: 800px; margin: 0 auto;.
Customizer option not found: Not all themes have a layout option. If you can’t find it, use the page template or CSS method instead.
Changes not showing on all pages: If you used the Customizer, check that you applied it to the correct scope (global vs. specific pages). If you used a page template, ensure you selected it for each page individually.
Frequently Asked Questions
Will removing the sidebar affect my site’s performance?
No, removing the sidebar does not directly affect performance. However, if you remove it via CSS, the sidebar is still loaded in the HTML, which might slightly increase page size. For best performance, use a template that doesn’t load the sidebar at all.
Can I remove the sidebar from only one page?
Yes, the easiest way is to use a full-width page template on that specific page. Alternatively, you can add a CSS class to that page and target it with custom CSS.
What if my theme doesn’t have a full-width template?
You can create one by copying your theme’s page.php file into your child theme, renaming it to page-full-width.php, and removing the line that calls get_sidebar(). Then select that template in the page editor.
Will removing the sidebar hide my widgets?
Yes, any widgets placed in the sidebar will no longer be visible. You can move them to a different widget area (like a footer) if you want to keep them.
Can I remove the sidebar from my blog posts but keep it on pages?
Yes, you can target the post content with CSS (e.g., .single #secondary { display:none; }) or use a different template for posts.
Is it better to remove the sidebar or keep it?
It depends on your design. Full-width content can improve readability for long articles, while sidebars are useful for navigation, ads, or related content. Consider your users’ needs.