---
title: "Magento 2: How to Set My Account Page Title with Customer Name"
url: "https://magecomp.com/blog/magento-2-set-my-account-page-title-with-customer-name/"
date: "2025-04-28T11:41:28+00:00"
modified: "2025-04-28T11:41:29+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 455
reading_time: "3 min read"
summary: "Hello Magento Friends,"
description: "Learn how to personalize the My Account page title in Magento 2 by dynamically displaying the customer's name."
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "What are the Steps to Download Magento 2 With and Without Sample Data?"
    url: "https://magecomp.com/blog/how-to-download-magento-2-with-without-sample-data/"
  - title: "Magento 2: How to Pass Multi-Dimensional Array as an Argument in GraphQL"
    url: "https://magecomp.com/blog/magento-2-pass-multi-dimensional-array-as-argument-in-graphql/"
  - title: "How to Display Image in Custom Module using Form Field in Magento 2"
    url: "https://magecomp.com/blog/display-image-in-custom-module-using-form-field-in-magento-2/"
---

# Magento 2: How to Set My Account Page Title with Customer Name

_Published: April 28, 2025_  
_Author: Dhiren Vasoya_  

![Magento 2 How to Set My Account Page Title with Customer Name](https://magecomp.com/blog/wp-content/uploads/2025/04/Magento-2-How-to-Set-My-Account-Page-Title-with-Customer-Name-1024x512.webp)

**Hello Magento Friends,**

The My account page of the customer interface in Magento 2 is a critical part of the customer experience. The default page title is a bit dull – just “My Account”.

![My account page title before](https://magecomp.com/blog/wp-content/uploads/2025/04/My-account-Page-title-before.webp)Wouldn’t it be much better to do something like dynamically adding the customers name into the page title?

For example, it could read “Dhiren Vasoya’s Account” instead of just “My Account”!

In this blog, I will show you how to change the My Account page title dynamically with the customer’s name in Magento 2.

[![Hire Magento Programmer](https://magecomp.com/blog/wp-content/uploads/2025/02/Hire-Magento-Programmer-CTA-5.webp)](https://magecomp.com/services/hire-magento-programmer/)

## Why Personalize the Account Page Title?
- Enhances customer experience by being personal.
- Adds professionalism to your store.
- Creates trust and engagement with customers.

## Steps to Set My Account Page Title with Customer Name in Magento 2:
**Step 1:** Create a **di.xml** file at the given path

**app/code/Vendor/Extension/etc/frontend/di.xml**

Now add the code as follows:

```
<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="MagentoCustomerControllerAccountIndex">
        <plugin name="Vendor_Extension::my_account" type="VendorExtensionPluginCustomerControllerAccountIndex" sortOrder="10"/>
    </type>
</config>
```

**Step 2:** Create a **customer_account_index.xml** file at the given path

**app/code/Vendor/Extension/view/frontend/layout/customer_account_index.xml**

Now add the code as follows:

```
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
  <body>
    <referenceBlock name="page.main.title">
      <action method="setPageTitle">
        <argument translate="true" name="title" xsi:type="string"> </argument>
      </action>
    </referenceBlock>
  </body>
</page>
```

**Step 3:** Create an **Index.php** file at the given path

**app/code/Vendor/Extension/Plugin/Customer/Controller/Account/Index.php**

Now add the code as follows:

```
<?php

namespace VendorExtensionPluginCustomerControllerAccount;
class Index
{
    /**
     * @var MagentoCustomerModelSession
     */
    protected $customerSession;
    /**
     * @param MagentoCustomerModelSession $sessionSession
     */
    public function __construct(
        MagentoCustomerModelSession $sessionSession
    ) {
        $this->customerSession = $sessionSession;
    }
    public function afterExecute(
        MagentoCustomerControllerAccountIndex $subject,
        $resultPage
    ) {
        $resultPage->getConfig()->getTitle()->set(__('Welcome back %1', $this->customerSession->getCustomer()->getName()));
        return $resultPage;
    }
}
```

**Output:**

Now, when a logged-in customer goes to check out the My Account page (customer/account/index), they will see the personalized page title:

**Welcome back Dhiren Vasoya**

Instead of the dull “My Account.”

![My account Page title after](https://magecomp.com/blog/wp-content/uploads/2025/04/My-account-Page-title-after-1024x426.webp)

## Conclusion:
Personalizing small things, like the My Account page title, makes a considerable difference in the way users experience your Magento 2 store. This not only adds a level of professionalism to your store but can also help increase customer satisfaction subtly and increase loyalty.

[![Magento version upgrade](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Version-Upgrade-CTA-2-2.webp)](https://magecomp.com/services/magento-upgrade-services/)Relevant Read – [**How to Change My Account Navigation Links Title Dynamically in Magento 2?**](https://magecomp.com/blog/change-account-navigation-links-title-dynamically-magento-2/)

</body>


---

_View the original post at: [https://magecomp.com/blog/magento-2-set-my-account-page-title-with-customer-name/](https://magecomp.com/blog/magento-2-set-my-account-page-title-with-customer-name/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-08-26 14:03:14 UTC_  
