Website Building » WooCommerce » How Do I Edit Breadcrumbs in WordPress WooCommerce?

How Do I Edit Breadcrumbs in WordPress WooCommerce?

Last updated on January 18, 2023 @ 6:19 am

Breadcrumbs are a great way to help visitors navigate your website, and they can also be a helpful tool for search engine optimization (SEO). If you’re running a WooCommerce store on WordPress, you may want to edit the breadcrumbs to better suit your needs.

In this article, we’ll show you how to edit breadcrumbs in WordPress WooCommerce.

There are two parts to editing breadcrumbs in WooCommerce: changing the text and changing the format. To change the text of the breadcrumbs, you’ll need to edit the files in the WordPress editor.

To change the format, you’ll need to use a plugin or edit the code yourself.

To change the text of the breadcrumbs:

    1. Log into your WordPress site and go to your Dashboard.

    2. In the left-hand sidebar, hover over Appearance and click Editor.

    3. On the right-hand side, find the Theme Functions (functions.php) file and click it.

    4. Scroll down to line 1687 and find this line of code: $breadcrumb->add_crumb( $shop_page->post_title, $shop_page_url );.

    5. Replace $shop_page->post_title with the text you want to display for your shop page breadcrumb. For example, if you wanted to display “My Shop” as the shop page breadcrumb, you would change this line of code to $breadcrumb->add_crumb( “My Shop”, $shop_page_url );.

    6. Save your changes and check your website to see the new text displayed in the breadcrumbs.

To change the format of the breadcrumbs:

(Option 1): Use a Plugin

If you don’t want to edit any code yourself, there are some great plugins that can help you change the format of your breadcrumbs. Two popular plugins are Yoast SEO and BreadCrumb NavXT.

(Option 2): Edit The Code Yourself

If you’re comfortable editing code, you can make changes to your WooCommerce breadcrumbs yourself. First, you’ll need to access your site’s files via FTP or SSH.

  1. Connect to your site via FTP or SSH and go to the /wp-content/themes/YOUR-THEME-NAME/ directory.
  2. Download the functions.php file to your computer.
  3. Open functions.php in a text editor like Notepad++ or Sublime Text.
  4. “Find” (Ctrl + F on Windows, Command + F on Mac) for this line of code:
    // Add support for WooCommerce 
  5. “Find” for this line of code:
    add_theme_support( 'woocommerce' ); 

Replace both instances of “YOUR-THEME-NAME” with the actual name of your theme.

  1. “Find” for this line of code:
    // Change number of products per page 

On line 107 (in my theme), I found these lines of code:
$number = get_option( ‘posts_per_page’ ); add_filter( ‘loop_shop_per_page’, create_function( ‘$cols’, “return $number;” ), 20 );

  1. “Find” for this line of code (it will be further down in your file):
    /** * Changes number .. products per page */ function wc4bp_xprofile . */ 

I found these lines on line 140 in my theme: function wc4bp_xprofile . $perPage = get_option(‘wc4bp .’); // How many Profile fields show per tab? default is 25. return $perPage;

  1. “Find” for this line of code (it will be further down in your file):
    additional arguments 

Replace both instances of “YOUR-THEME-NAME” with actual name.theme. You should now have something that looks like this:

  1. Save functions.

    php and upload it back. server, overwriting original file. Check website. see if changes have been made. If not, try refreshing browser cache.

As you can see, editing breadcrumbs. WooCommerce is not difficult, but it does require some knowledge. editing code. If you’re not comfortable making these changes yourself, we recommend using one. plugins listed above.

Kathy McFarland

Kathy McFarland

Devops woman in trade, tech explorer and problem navigator.