• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero® Blog

NameHero® Blog

Web Hosting Tips & Resources From NameHero

  • Hosting
    • Web Hosting
    • VPS Hosting
    • WordPress Hosting
    • WooCommerce Hosting
  • Reseller
  • Enterprise
  • Domains
  • Account
  • Blog Home
  • Categories
  • Authors

How To Lock WordPress Gutenberg Blocks From Editing

Bhagwad Park

Published on: June 13, 2022

Categories: WordPress 1

Earlier this year, I wrote about how to avoid accidentally editing your reusable blocks in WordPress Gutenberg. However, the new WordPress version 6.0 adds this functionality by default to the WordPress editor, and it comes with some nice perks as well! Here’s how it works.

Locking Blocks in Gutenberg

While the earlier plugin only worked on reusable blocks, the new functionality in WordPress applies to all blocks equally. Just select one, then click the three dots to access the block settings. Here you’ll see a new “Lock” option like this:

Locking Blocks in WordPress Gutenberg
Locking Blocks in WordPress Gutenberg

This will bring up a screen where you have three options for locking the block:

Three Options to Lock a Block in WordPress Gutenberg
Three Options to Lock a Block in WordPress Gutenberg
  • Restrict editing
  • Disable movement
  • Prevent removal

The three options are pretty self-explanatory. The first prevents you from accidentally editing a block, the second disallows using the arrow buttons to move the block up or down, and the third prevents users from deleting it. These are extremely useful for the following scenarios.

1. Restrict Editing Uses

Often when you create a reusable block, you can accidentally make changes to it without noticing. for example, you can hit the “Enter” key, on the last element, thinking that you’re creating a separate paragraph block, but in reality, you’ve just added a new block to the reusable group, and if you save your changes, all the other reusable blocks that you’ve added throughout your site will change as well. This is obviously a serious mistake.

Preventing the editing of a block can also be useful when your content is written by other people and you don’t want them messing with your blocks. These can be calls to action or certain graphics. When you let others edit posts in Gutenberg, you don’t have control over what they do, locking down a block to prevent editing is the best way to ensure nothing changes.

2. Disabling Movement

Disabling the movement of blocks prevents the user from using either shortcut keys or the graphical interface to move blocks up or down. Of course, you can always move or remove other blocks that surround this one, but that takes a lot more effort since the arrows icon disappears when the “Disable movement” option is selected:

Movement Icons Disabled
Movement Icons Disabled

Certain items like CTA buttons have a specific place on a page, and disabling their movement ensures that they’re positioned correctly. It makes the most sense to use this when the block is in the middle of two other blocks that shouldn’t be changed. Otherwise, someone can just add new content above or below the locked block and work around the restrictions that way.

3. Prevent Removal

If you have a certain block that’s necessary for legal reasons, you can prevent others from removing it altogether. Disclaimers are a great example of this kind of block that you shouldn’t remove. Affiliate link disclaimers, cookie disclaimers, and more fit into this category. Other examples include author blocks and related meta-information like schemas and more.

Depending on how you structure your site, you need to decide between putting these blocks in a template, or in posts individually. If you choose the latter, it’s a good idea to lock them down and prevent their removal.

The Block Editor Comes Closer to a Page Builder

With the ability to lock blocks, the Gutenberg editor is becoming a hybrid of an editor and a page builder. Soon, ordinary folk will be able to create page templates without any code, and without needing to edit theme files. At this rate, it’s just a matter of time before we’re able to create our own themes without a single line of code!

Bhagwad Park Profile Picture
Bhagwad Park

I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!

Related Posts

WordPress Hosting vs. Web Hosting – What’s The Difference?

Although very similar, WordPress hosting vs. web hosting can be confusing. Check out our guide to make you pick the right type of hosting!

How To Sort Posts By The “Last Modified” Date

Instead of sorting the WordPress posts and pages by the publication date, here's how to sort them by the modified date instead.

3 Best Property Management WordPress Themes (2023)

If you own a property management business, you must know that having a website is no longer optional in 2023. Because in today’s digital world, having an online presence makes a massive difference to the success of your business. A well-built website helps you attract potential clients and stand out from the competition. Not only […]

Gutenberg vs. Elementor – WordPress Theme Builder Comparison (2023)

Learn the pros and cons between the default installed WordPress Gutenberg and Elementor (free or paid version).

Reader Interactions

Comments

  1. B says

    July 24, 2023 at 3:17 pm

    Hi,

    Restrict editing only works for reusable blocks. Is there a way to restrict editing for non reusable blocks?

    Reply

Leave a Reply Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!

Most Popular Posts

NameHero’s Recommended WordPress Plugin and Theme Setup (2023)

WordPress Hosting vs. Web Hosting – What’s The Difference?

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • WordPress Tutorials
  • Enterprise Hosting
  • WooCommerce
  • Web Hosting
  • Resellers
  • Website Security
  • Website Development
  • Website Performance
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero® proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • Domains
Help & Support
  • NameHero Blog
  • Support
  • Help Center
  • Migrations
  • Affiliates
  • Call 1-855-984-6263
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2023 Name Hero, LLC. All rights reserved.
NameHero® is a registered trademark.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA