We are writing this blog post to answer with more details a common question we get from our customers who bought our module Prestashop SEO Manager. We have described the answer on the frequently asked questions 3 page.

In this Prestashop tutorial, you will learn about how to remove the shop name from the meta title.

We were reluctant to provide a hack mainly because it will impact Prestashop Core code and it requires technical skills from e-merchants when it comes to controllers/classes overriding. Even if we provide a script below to tackle the issue, we will not support any customer later on.

How meta title are generated with Prestashop

A meta title displayed in the frontend of your Prestashop retail point is the aggregation of the meta title field (from either a product record or a category,…) and the name of the shop that is appended to the end. Usually it is redundant as it uses the exact same words as the domain name. For that reason, most of our customers ask to get this removed.

 

Preconditions.

You would need an FTP client like Filezilla together with a text editor application like Notepad++/sublime.

The code hack below was made on Prestashop 1.6.1.4. However it applies to Prestashop 1.5.x.x to Prestashop 1.6.1.x (current version is 1.6.1.7)

Overriding Prestashop Class

We will override the default behaviour of Prestashop and generate a new file in the dedicated override folder.

Prestashop manages the meta fields with the class Meta.php.

Log into your root folder with your FTP application,

Then download the file Meta.php located in classes/Meta.php . After you change it then upload the new version of the file in the folder override/classes/.

Start a new file named Meta.php. This new file will be moved to the override folder and we need to copy only few PHP methods in here.

Edit the class Meta.php from Prestashop. We will modify this file by removing all the references to the script Configuration::get(‘PS_SHOP_NAME’). The impacted methods are:

  • completeMetaTags,
  • getHomeMetas,
  • getManufacturerMetas,
  • getCategoryMetas,
  • getSupplierMetas,
  • getCmsMetas,
  • getCmsCategoryMetas

 

Let’s start with getHomeMetas. The function on Github (https://github.com/PrestaShop/PrestaShop/blob/1.6.1.4/classes/Meta.php#L232) was changed to the one below:

 

Download:

This tutorial complements our module SEO Manager. It helps to remove Prestashop shop name from the end of your meta titles. Please refer to our blog post https://www.onasus.com/prestashop-seo-module-faq-part-3/ to find out more. You can download the new file Meta.php here.

We will answer your questions as much as possible. However we will not provide any further support.

Download