• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Startup Hero

The Official Blog Of Name Hero

Learn To Fly Above The Competition Get Started
  • HomeWelcome
  • CoursesVideo Training Center
  • About UsWhat is StartupHero?
  • BlogGet the latest
  • Start HereStartup 101
  • SpeakingPodcast & Media
  • ResourcesTools to help You
    • Reselling WordPress Hosting
    • Resell Hero
    • How To Start A Blog
  • NameHeroCloud Web Hosting

How To Avoid Editing Reusable Blocks In WordPress

By Bhagwad Park on March 23, 2022 3

How To Avoid Editing Reusable Blocks In WordPress

Reusable blocks in WordPress Gutenberg are an amazing feature that has greatly improved the maintainability of code on websites. I use them all the time for block scripts, special CSS instructions, and even for some repeatable patterns. The WordPress pattern directory is still a work in progress, and you can’t create your own patterns without writing special code. That’s not sustainable in the long run.

Unfortunately, reusable blocks are very easy to accidentally modify. Particularly when there are multiple blocks grouped, it can get hard to select the block as a whole instead of one of the individual elements within. For example, take this reusable block I created as a test:

Creating a reusable block
Creating a reusable block

In this group, I have two paragraph blocks, and one image block with a caption underneath. Now let’s say I want to add a block above it, so I click on the reusable block, and press “Ctrl+T” to insert a new block above. Unfortunately, because they occupy the same space, I’ve ended up selecting the first paragraph instead of the block itself. This “edits” the reusable block, and gives an error message like this when I try and save the post:

Accidentally Modifying a Reusable Block
Accidentally Modifying a Reusable Block

The post is asking me if I want to save not just the content, but the contents of the reusable block itself. The worst part is that you might not even realize that you’ve modified your reusable block. If you careless click “Update” or “Save”, the modified block will change on all the previous posts and pages in which you’ve used it. It can have massive consequences to your site if it’s a commonly used block.

So what’s the solution?

The Lock Reusable Blocks Plugin

This morning, I came across this useful plugin that locks reusable blocks and prevents you from editing them by accident. Most of the time, this is what you want. You can download and install the Lock Reusable Blocks WordPress plugin. Once activated, you don’t need to do anything. The next time you use a reusable block in your post, you’ll see the following when you click on it:

Using the Lock Reusable Blocks Plugin

The entire block has been locked, and you can’t edit it by mistake.

Using Reusable Blocks as Patterns

I often use reusable blocks to recreate patterns on my site that I can fill with my content, depending on the situation. The problem is that you first need to “convert” the reusable group into “regular” blocks. If you omit this step and accidentally save your changes, they’ll be propagated throughout your site. Hopefully, you’ll realize your mistake in time.

The Lock Reusable Blocks plugin adds another button next to the “Edit” option that lets you convert reusable blocks to regular ones. Once you do this, you no longer have to worry about messing things up, and you can safely make the changes you want.

It’s a little thing, but makes such a difference! I feel that WordPress should make this functionality available as a default option. Most people who use reusable blocks don’t want to immediately make changes to them, and if they do, it’s probably because they forgot to convert them into regular blocks. I see no downside to making this happen.

Perfect for Multiple Editors

Of course, you can’t install every single plugin that catches your fancy. I can’t even say for sure that I’ll use it on my own site – WP-Tweaks.com. However, if you have multiple writers, and you want to make sure that none of them accidentally screw things up, this plugin is indispensable. You can’t take the risk that one of your writers will mistakenly edit a reusable block with site-wide consequences. So for that use case scenario, it’s perfect!

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!

Reader Interactions

Comments

  1. Marie Comet says

    May 2, 2022 at 7:41 am

    Thanks for sharing my plugin, I’m happy it is usefull for you 🙂

    Reply
    • Bhagwad Park says

      May 2, 2022 at 12:18 pm

      You’re welcome, and thank you for making such a useful plugin!

      Reply
  2. Aamir Hussain says

    November 6, 2022 at 5:23 pm

    Can i set convert to regular block as default, so I don’t have to convert it each time I insert a reusable block?

    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

Connect With Us!

Superhero Resources

Fix Common Issues

  • How To Setup Free And Automatic SSL Certificates
  • How To Setup Cloudflare With Railgun
  • How To Fix Memory Exhausted Errors In WordPress
  • How To Edit PHP Version/Upload Limit/Add Extensions
  • How To Move/Migrate Your Business To Name Hero

Free Guides

  • How To Setup NameHero Hosting
  • How To Create A Web Hosting Business With WordPress
  • How To Start A WordPress Blog
  • How To Migrate WordPress To A VPS
  • How To Speed Test And Optimize Your WordPress Website
  • Magento 2.X Installation Guide
  • How To Clean Up A WordPress Hack

Training

Recent Posts

  • The Best WordPress Plugin To Combat Plagiarism
  • Is It Time to Bring Back Blog Comments?
  • Two Filters That No Longer Work In Gutenberg (And Workarounds)
  • Migrating To The New Cloudflare Managed Rules Interface
  • How To Sort Posts By The “Last Modified” Date
  • How To Make WordPress Send E-mail From Another Address
Subscribe in a reader
  • Web Hosting
  • WordPress Hosting
  • Reseller Hosting
  • VPS Hosting
  • Twitter
  • Facebook
  • LinkedIn
  • YouTube
  • FTC Disclosure
  • Earnings Disclosure
  • Privacy Policy

Copyright © 2023 · Smart Passive Income Pro on Genesis Framework · WordPress · Log in