WordPress 5.9 to Introduce New API for Locking Blocks

Category Image 091

The advent of block themes delivers more creative power into the hands of users, but there are times when theme authors may want to lock down key elements of a design and its designated content areas. First introduced in Gutenberg 11.6, the upcoming WordPress 5.9 release will include a new API for locking blocks.

Template level locking has been available in Gutenberg for a few years, allowing developers to lock the template on the UI so that users can’t manipulate the blocks. This new API offers more granular control that can be applied on the block level and override template locking.

“Instead of applying a lock to all inner blocks, you can apply it selectively to individual blocks via the lock attribute,” Marcus Kazmierczak said in the dev note. “The block level locking would supersede the inherited templateLock value. You can choose to lock moving or removing a block.”

One of the primary use cases for locking individual blocks, cited in the ticket proposing the new API, is where one might lock the “post-content” block of a single template so users can’t remove it.

“Another use case that we’re building for is having a Checkout Block with different blocks that act as fundamental steps, we don’t want people to delete or move those steps since they’re fundamental and their order is also important, but we want to allow people to select them, access settings, and insert blocks in between them,” WooCommerce engineer Seghir Nadir said.

Kazmierczak’s dev note demonstrates how developers can lock a specific block in a pattern and explained how block level locking is not inheritable.

“If a block is locked from being removed, its children can still be removed,” Kazmierczak said. “If you want to apply locking on children as well, add templateLock to the inner block component, or templateLock attribute to supporting blocks.”

For more information on the new locking mechanism, check out the Block Editor Handbook and the code examples in the dev note.

How to Change the WooCommerce Shop Page Title (Quick & Easy)

Set Up Woocommerce

Do you want to change the shop page title in WooCommerce?

By default, your main shop page is simply called ‘Shop’. You may want to change the default title to be more descriptive and engaging, and better reflect your brand.

In this article, we’ll show you how to change the WooCommerce shop page title easily.

How to change the WooCommerce shop page title (quick & easy)

Why Change the Shop Page Title in WooCommerce?

When you install WooCommerce, it will automatically create pages like your shop page, account page, checkout page, and more.

By default, the shop page title will be ‘Shop’, but you can change this to anything you want, like ‘Boutique’ or ‘Store’ or something more detailed and descriptive. Overall, this can help create a better shopping experience and help build trust with your visitors.

Customizing your shop page title can also help your WooCommerce search engine optimization. Google and other search engines look at the words used in page titles to determine how to rank them in search results. If your shop page title is more descriptive, it can help you get more traffic to your online store.

With that said, let’s show you how to easily change the WooCommerce shop page title. Simply use the quick links below to jump straight to the method you want to use.

Method 1: Changing the WooCommerce Shop Page Title with Built-in WordPress Settings

The easiest and most beginner friendly way to change the shop page title in your online store is by using the built-in settings.

To change the title of your shop page, simply go to Pages » All Pages. You’ll need to find the page that says ‘Shop – Shop Page’ and then hover over it and click the ‘Edit’ button.

Go to all pages and open shop page

From here, you can enter a new page title at the top of the page.

Make sure to click the ‘Update’ button to save your changes.

Add new shop page title

Now, you can visit your shop page, and you’ll see your new shop page title live.

Changing your shop page title this way will update your breadcrumbs and navigation menu too.

Shop page new title example

Method 2: Changing the WooCommerce Shop Page Title by Adding Code to WordPress

Some WooCommerce themes might not give you the option to change your shop page title.

To do this, you’ll need to add code to WordPress. If you haven’t done this before, then see our guide on how to copy and paste code in WordPress.

Then, you can add the following code snippet to your functions.php file, in a site-specific plugin, or by using a code snippets plugin

add_filter( 'woocommerce_page_title', 'new_woocommerce_page_title');
 
function new_woocommerce_page_title( $page_title ) {
 
  if( $page_title == 'Shop' ) {
 
    return "New Shop Title";
 
  }
 
}

Make sure you replace the ‘New Shop Title’ with your own shop page title in the snippet above.

Now, you can visit your online shop page to see your new title live. You’ll notice this method doesn’t change the shop page URL or WooCommerce breadcrumbs, but only changes the title on the page itself.

Shop page title example with code

Method 3: Changing the WooCommerce Shop Page SEO Title with a WordPress Plugin

Another way to change your WooCommerce shop page title is by changing the shop title that shows up in the search engines, which is called the SEO title or title tag.

This can be a great way to get more traffic and target more relevant keywords related to your online store.

The easiest way to do this is by using the AIOSEO plugin. It’s the best WordPress SEO plugin in the market used by over 3 million websites. 

AIOSEO

You can use the plugin easily optimize your SEO title to improve your search engine rankings.

For more details on setting up the plugin, see our guide on how to setup All in One SEO for WordPress correctly.

After that, you can easily change your shop page SEO title by opening up your shop page and scrolling down to the ‘AIOSEO Settings’ box beneath the page editor.

You can use smart tags to automatically generate the shop page title, or enter a custom title instead.

AIOSEO shop page title

If you want to fully customize the title and page design of your WooCommerce shop page, then we recommend using SeedProd.

It’s a drag & drop design builder that lets you customize every Aspect of your WooCommerce store.

SeedProd WooCommerce Design Builder

We hope this article helped you learn how to change the WooCommerce shop page title. You may also want to see our expert pick of the best WooCommerce plugins and best WooCommerce hosting for creating a successful online store.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Change the WooCommerce Shop Page Title (Quick & Easy) first appeared on WPBeginner.