Google Search Console verification code in PrestaShop, for good
You can add a Google Search Console verification code to PrestaShop in three ways: a TXT record in the domain's DNS, an HTML file in the store's root folder, or a meta tag in the theme header. The DNS record doesn't touch the store and survives every update. The meta tag is the simplest, but in a bought theme it can vanish after an update.
Author: The TellMyShop team. A guide for PrestaShop store owners: the cause, the manual fix and the same work in a chat conversation.
Last updated: · 5 min read
Why does a store need a verification code?
The code confirms the store belongs to you. Without it, Search Console won't show you reports on indexing, 404 errors or the queries that bring customers to your store. Meta requires a similar domain verification so your business can manage links in ads and pixel events.
The code isn't a one-off. Google comes back to it from time to time and checks whether it is still there. This is described in the Search Console help on verifying ownership. That's why it matters whether the code survives the next theme update.
Which verification method should you choose?
Choose DNS if you can, and the header tag if DNS is out of your reach.
| Method | Where you do it | What it survives | When to choose it |
|---|---|---|---|
| TXT record in DNS | domain or hosting panel | everything, store changes don't affect it | you have DNS access and want to cover the whole domain |
| HTML file | FTP or file manager, the store's root folder | theme updates, but not always a store move | you have FTP and don't want to touch the theme |
| Meta tag in the header | the theme's header file | updates only in a child theme | you have no access to DNS or FTP |
| Verification code module | Modules > Module Manager | theme updates, but it is one more module to maintain | you often add different codes |
Meta offers the same three routes: a DNS record, a file and a meta tag. You'll find the instructions in Meta's help on domain verification. The Google and Meta tags can sit side by side in the same file.
How to add a meta tag to the PrestaShop header
You paste it into the template that builds the head section of every page, then clear the cache.
- Copy the tag. In Search Console choose the “HTML tag” method. You'll get a line
<meta name="google-site-verification" content="...">. - Check which theme is active. In the admin: Design > Theme & Logo. If it is a bought theme or Classic, changes typed directly into its files will disappear after an update.
- Ideally, work in a child theme. It inherits everything from the parent theme, and your changes stay through updates. The mechanism is described in the PrestaShop documentation on child themes.
- Open the header file. In the Classic theme it is
templates/_partials/head.tpl. Paste the tag, for example, below the meta charset line. - Clear the cache. Advanced Parameters > Performance, the button in the top right corner. The settings on that page are described in the performance documentation.
- Go back to Search Console and click Verify. If verification fails, open the home page source and look for the tag. If it isn't there, the store is most likely showing an old cached version.
If the tag is in the source but Google still doesn't see it, check that you are verifying the same address you are opening. The www and non-www versions are two different properties for Search Console.
Why does the code disappear after a theme update?
Because the update overwrites the theme files with the author's version. Your line in head.tpl goes with the old file. A few days later Search Console reports lost verification, and you don't connect it with the update from a week ago.
There are two ways out. The first is the DNS record, which lives outside the store. The second is a child theme, in which the header file belongs to you. Also remember that after moving the store to a new server, the HTML verification file has to move with the rest of the files.
How to add the tag without opening theme files
You paste the tag into your request, and your chat (Claude or ChatGPT) finds the active theme's header file and shows the differences before saving. After your approval it saves the file, clears the cache and reminds you to click Verify in Search Console.
You: Add the Google verification code to the header of every page: <meta name="google-site-verification" content="abc123">. Show me the change.
Your chat: The active theme is the child theme “lantern-store”. The header is built from templates/_partials/head.tpl. Preview of the change in that file:
Before saving I'll make a copy of the file. After saving I'll clear the cache. Save?
You: Yes.
Your chat: Saved, cache cleared. Now click Verify in Search Console. The copy of the file from before the change is in the backup history, so you can go back to it with one request.
old version: <meta charset="utf-8">
new version: <meta charset="utf-8">
new version: <meta name="google-site-verification" content="abc123">
Changes to theme files need the Theme switch. You turn it on separately in the module panel. The switch works for 24 hours and needs a database backup made the same day. This work is done by TellMyShop Pro, and the use case adding a verification code to every page shows how it goes. A theme file change doesn't go into the normal change history. You undo it by restoring the copy of the file the module makes before every save. You can check what TellMyShop Pro costs on the pricing page.
The chat only saves in the active theme. If a bought theme is active without a child theme, the chat will warn you. It can prepare a child theme, but you activate it yourself in the admin. The change history doesn't undo creating a child theme.
In TellMyShop Free the chat won't look into theme files, but it will check whether the home page responds without redirects and which address it declares as canonical. That helps when verification fails because Search Console has the www address and the store runs without it, or the other way round. If the store still shows the old header after adding the code, read what to do when changes aren't visible in PrestaShop. We write about other theme file changes in the piece on removing Powered by PrestaShop.
Questions and answers
Can I remove the code from the store after verification?
Better not. Google checks from time to time whether the code is still there. When it disappears, for example after a theme update, you lose owner status in Search Console. The data isn't lost, but access to reports and settings only comes back after you verify again. So you leave the code in place for good, just like the Meta code.
Which verification method is best for a PrestaShop store?
A TXT record in DNS, if you have access to the domain panel. It covers the whole domain, with the http, https and www versions, and changes in the store don't affect it. Choose the meta tag in the theme header when someone else manages the DNS, or you need verification quickly without waiting for DNS to refresh.
Where in a PrestaShop theme do I paste the meta tag?
In the template that builds the head section of every page. In the Classic theme that is templates/_partials/head.tpl. Bought themes often have their own file or a field in the theme configuration. You paste the tag, for example, below the meta charset line, save the file and clear the cache in Advanced Parameters > Performance.
Does Meta domain verification work the same way as Google's?
Almost. Meta also offers a TXT record in DNS, an HTML file or a meta tag in the home page header. Only the tag name differs, and where you get the code: in the business settings in Meta Business Suite. Both tags can sit side by side in the same header file.
Is TellMyShop Free enough to add the tag?
No. In TellMyShop Free the chat only reads store data. Saving the tag in a theme file needs TellMyShop Pro and the Theme switch turned on. You turn it on in the module panel for 24 hours, and it needs a database backup made the same day. Before saving you see the differences in the file, and the module makes a backup copy.
PrestaShop is a registered trademark of PrestaShop SA. Claude is a trademark of Anthropic PBC. ChatGPT and OpenAI are trademarks of OpenAI. TellMyShop is not affiliated with these companies.