Scotts Web Dev Banner
Did you notice... every article on this site has an associated video? Consider subscribing to Scotts Web Dev on YouTube! :)

How To Hide Sections On WordPress Site

It’s a common request. There’s a section on your WordPress site that you want to remove from the page visually. This section could be a small piece of text or an entire section.

I’ll show you how to remove it, here.

You’ll Need To Use A Little CSS To Hide Sections On Your WordPress Site

To hide a section, all we need is a little bit of CSS. For the most part, this is easy enough. You can login to your backend and go to appearances -> customize -> additional css.

This is where you’ll enter the CSS code needed to hide the sections.

Find The ID Or Class Name of The Element You Want To Hide

Before we can write any CSS, we need to find the id or class name of the element you want to hide.

Right click on the element you want to hide and go to “Inspect”. Hover over the elements in the inspector (see video above) until only the element you want to hide is highlighted.

From there, you can find the ID or class name of that element.

We will use this element in a CSS selector and set it’s display to none.

Now, Write The CSS

This is a bit of a hard topic to textualize but it’s really pretty simple. Say your element had an ID of “my-element”. In the additional CSS you would put:

#my-element {
    display: none;
}

If you had a class name of “my-class”, you would put:

.my-class {
    display: none;
}

Use “#” For ID’s And Use “.” For Class Names

If you’ll notice in the examples above, if the element has an id and you’re using that, you’ll use the hash sign. If you’re using a class name, you’ll use a period.

Some Classes Are Not Specific To The Element

Try to find the most unique class name for your element. It might have several classes (again, see the video above).

It Can Get Tricky, Too

If your element does not have an ID, or a unique class name, it can get tricky to hide it. You’ll then have to either give it an ID or a unique class name, or write a more complicated CSS selector.

If you need specific help, I’d be happy to help if you comment on my video above. Just leave your URL and the section you’d want to hide, and I can help you write the CSS for it.

Or learn CSS selectors – they’re fun!