Posted on

Change the Shop page title

You know that WooCommerce generates the Shop page automatically, you only need to select what page to use in the settings.
Also, it does not matter what title your page has, it will still use the title “Product – Your site name”.

How to change it?

Add this code at the end of the file functions.php in wp-content/themes/your-child-theme-name/:

This code will only work on the Shop page and won’t affect any other page in your website.

6 thoughts on “Change the Shop page title

  1. […] can change the WooCommerce shop title with this tutorial from Nicola […]

  2. thanks. works like a charm. i edited it, so it return the actual page title of the shop page defined in wc:

    /**
     * Change the Shop archive page title.
     * @param  string $title
     * @return string
     */
    function wc_custom_shop_archive_title( $title ) {
        if ( is_shop() && isset( $title['title'] ) ) {
            $shop_page_id = wc_get_page_id( 'shop' );
            $title['title'] = get_the_title( $shop_page_id );
        }
    
        return $title;
    
    }
    add_filter( 'document_title_parts', 'wc_custom_shop_archive_title' );
    
  3. even a bit nicer:

    /**
     * Change the Shop archive page title.
     * @param  array $title
     * @return array
     */
    function wc_custom_shop_archive_title( $title ) {
        if ( is_shop() && isset( $title['title'] ) ) {
            $title['title'] = get_the_title( wc_get_page_id( 'shop' ) );
        }
    
        return $title;
    }
    add_filter( 'document_title_parts', 'wc_custom_shop_archive_title' );
    
    1. Hi there!
      Thanks for the tweak 🙂

  4. how to change woocommers button text add to cart to Shop now

Leave a Reply

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