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.

8 replies
  1. jnz31
    jnz31 says:

    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' );
    
    Reply
  2. jnz31
    jnz31 says:

    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' );
    
    Reply
  3. Troy
    Troy says:

    im new with code but where do you change the name , my shops default has Products and another line saying add new products here. thanks

    Reply

Trackbacks & Pingbacks

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

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

You have to agree to the comment policy.

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