Magento Change Product Page Titles to Include Attributes

Magento Change Product Page Titles to Include Attributes

September 15, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento Change Product Page Titles to Include Attributes

Customizing Magento Product Page Titles

Are you looking to enhance your Magento site by adding custom product attributes to page titles? You’ve come to the right place! In this guide, I’ll walk you through the process of including custom attributes like ‘brand’ and ‘subtitle’ in your product page title tags.

Understanding Magento’s Default Behavior

By default, Magento uses a simple format for product page titles:

$productname

This is sufficient for basic needs, but it doesn’t leverage the full potential of your product data. Let’s dive into adding custom attributes to spice up your SEO and user experience.

Setting Up Your Custom Attributes

First things first—ensure you have created both ‘brand’ and ‘subtitle’ as custom product attributes in your Magento admin interface. Here’s a quick recap:

  1. Navigate to Catalog → Attributes → Manage Attributes.
  2. Click Add New Attribute if they don’t exist yet.
  3. Fill out the necessary details like attribute code, scope, etc.
  4. Set the frontend input type as per your requirement (e.g., text field).
  5. Save and apply.

Modifying the Product Page Title

Now that you have your custom attributes in place, it’s time to integrate them into your product page titles. This involves editing a core Magento template file:

  1. Open your Magento installation directory.
  2. Navigate to app/design/frontend/<your_package>/<your_theme>/template/catalog/product/view.phtml.

In this file, look for the following line around line 54:

<title><?php echo $_product->getName() ?></title>

You’ll want to replace it with something like this:

<?php $brand = $_product->getAttributeText('brand'); ?>
<?php $subtitle = $_product->getAttributeText('subtitle'); ?>

<title><?php echo $brand . " " . $_product->getName() . " " . $subtitle ?></title>

What we’ve done here is:

  • Retrieve the values of ‘brand’ and ‘subtitle’ attributes using $_product->getAttributeText('attribute_code').
  • Concatenate them with the product name surrounded by spaces.

Testing Your Changes

After saving your modifications, clear the Magento cache:

  1. Log in to your admin panel.
  2. Go to System → Cache Management.
  3. Select all check boxes and click Flush Magento Cache.

Now visit any of your product pages, and you should see the new page titles in action! The format will be something like this: “Brand Name Product Name Subtitle”.

Conclusion

And there you have it—a simple yet powerful way to enhance your Magento product pages using custom attributes. By following these steps, you can create more engaging and informative title tags that drive better SEO results.

Remember, optimizing your site for improved visibility is an ongoing process. For more advanced Magento tutorials and tips from experienced developers, check out the resources available at Laravel Company.

Don’t hesitate to reach out if you have any questions or need further assistance! Happy optimizing!

Catalog Themes Admin Configuration

Our network