How To Restrict Widgets

Updated on October 14, 2023

What’s in This Guide

In this how-to guide, you’ll learn how to restrict a sidebar and footer “widget”. There are 2 main ways WordPress themes support “widgets”:

  1. Using a block theme that has a site editor
  2. Managing widgets under Appearance > Widgets

We’ll describe how to add widget restrictions in both ways.

If your theme doesn’t support full site editing (FSE), you’ll need to manage your sidebars and footers under Appearance > Widgets.

We’ll cover adding a restriction to the following:

  • Content inside a sidebar using the site editor (Appearance > Editor).
  • A footer template part using the site editor (Appearance > Editor).
  • A sidebar widget block using Appearance > Widgets.
  • A footer widget block using Appearance > Widgets.

Since the sidebar and footer content are all blocks, we’ll follow the same steps for adding a restriction to a block in the block (Gutenberg) editor.

That includes accepting the Device Rules (show on all devices) and User Rules (any logged-in role can view).

Adding a Restriction to a Sidebar Using the Site Editor

We based the steps below using the sidebar example from the official Building Sidebars With the Site Editor WordPress tutorial. That means we’ll work with a sidebar inside a column block in the single (i.e., posts) template.

For reference, here’s what our post sidebar looks like on the front end of our site.

A post sidebar example with a search, heading, and latest posts block inside it.

Ready? Let’s get to it!

1. Go to Appearance > Editor from your WordPress admin dashboard

2. Click Templates

3. Click Single

We want to protect the sidebar content for all blog posts. All blog posts use the Single template. So we must edit the Single template.

4. Click Edit

5. Click the List View icon

6. Expand the Columns block and click your sidebar Column block

Following the official WordPress sidebar tutorial, we have 1 Columns block with 2 Column blocks inside. Click the Column block that has your sidebar.

Keep the Column block selected, or click any block you want to restrict inside that column.

7. Click Block Controls

Once you select the block you want to restrict, keep it selected and click Block Controls.

8. Click Enable Controls

9. Click Save

10. Click Save

Click Save once more to confirm.

You’re done! Congrats 🎉

Now, only logged-in visitors (by default) can see the sidebar when they bring up posts on your blog.

Do you want to restrict different devices and roles? Learn more about Block Controls in our how-to guide.

1. Go to Appearance > Editor from your WordPress admin dashboard

2. Click Template Parts

3. Click Edit

In our example below, we clicked on a Heading block.

5. Click Block

Make sure you have your Block settings tab selected for the block you want to restrict.

6. Click Enable Controls

Heads up!
If you don’t see your footer’s Block Controls settings, be sure Template Part is turned on in your Block Manager.

7. Click Save

8. Click Save

Click Save once more to confirm.

Nicely done 👏🏼

Now, only logged-in visitors (by default) can see the footer content you just restricted when they bring up your site.

Do you want to restrict different devices and roles? Learn more about Block Controls in our how-to guide.

Adding a Restriction to a Sidebar Widget

1. Go to Appearance > Widgets from your WordPress admin area

2. Expand your sidebar widget

3. Click a block in your sidebar widget, then click Enable Controls

Below, we enabled controls for a Heading block in our sidebar.

4. Click Update

Awesome job 🎉

Now, only logged-in visitors (by default) can see the footer content you just restricted when they bring up your site.

Do you want to restrict different devices and roles? Learn more about Block Controls in our how-to guide.

Adding a Restriction to a Footer Widget

1. Go to Appearance > Widgets from your WordPress admin area

wp-admin > Appearance > Widgets menu

Below, we enabled controls for a Heading block in our footer.

4. Click Update

Hooray 🎉

Now, only logged-in visitors (by default) can see the footer content you just restricted when they bring up your site.

Do you want to restrict different devices and roles? Learn more about Block Controls in our how-to guide.

Is this article helpful? What are your feelings