-
-
- Submit Updated Articles to Bing and Yandex with IndexNow in Joomla
- Add Published and Modified Date Meta Tags to Joomla
- Add Open Graph and Twitter Card Tags to Joomla
- Auto-Generate Meta Descriptions from Article Text in Joomla
- Add Noindex to Specific Pages in Joomla
- Verify Your Joomla Site with Google Search Console
-
- Add a View as Markdown Link to Joomla Articles
- Display the Last Modified Date in Joomla Articles
- Embed Iframes in Joomla
- Automatically Link Twitter (X) @mentions in Joomla Articles
- Open External Links in a New Tab in Joomla
- Display Estimated Reading Time in Joomla Articles
- Replace Old URLs in Joomla
- Search and Replace in Joomla
-
- Add a Footer Line to the Joomla Administrator
- Show a Staging Banner in the Joomla Administrator
- Remove the "All" Option from Admin List Limits in Joomla
- Add a Cookie Consent Banner to Joomla
- Make the Administrator Navigation Sticky in Joomla
- Add Google Fonts to Joomla
- Add a Facebook Messenger Chat Button to Joomla
- Add a Reading Progress Bar to Joomla
- Add a Custom Scrollbar to Joomla
- Show Confetti on a Thank You Page in Joomla
- Add Smooth Scrolling to Joomla
- Add a Back to Top Button in Joomla
- Add a WhatsApp Chat Button in Joomla
-
- Protect the Administrator with a Secret URL Key in Joomla
- Show a Welcome Message on First Login in Joomla
- Log Out Idle Administrators in Joomla
- Assign New Users to a Different User Group Automatically in Joomla
- Redirect Visitors by Country in Joomla
- Redirect Users After Login by User Group in Joomla
- Block User Registration with Certain Usernames in Joomla
- Block User Registration by Country in Joomla
- Block User Registration by Email Address in Joomla
- Block User Registration by IP Address in Joomla
- Remove the Forgot Password and Username Links in Joomla
- Remove the Generator Meta Tag in Joomla
- Let Users Log In with Their Email Address in Joomla
- Block Traffic by Country in Joomla
- Block Bot Traffic in Joomla
- Block Traffic by IP Address in Joomla
Remove the Generator Meta Tag in Joomla
Stop advertising that your site runs on Joomla by removing the generator meta tag from every page and feed, using one PHP snippet.
Every Joomla page tells visitors which CMS built it. Open the page source and you'll find this line in the <head>:
<meta name="generator" content="Joomla! - Open Source Content Management">
Tools that detect a site's CMS read this tag first, and so do automated scanners hunting for Joomla sites. Your RSS and Atom feeds carry the same line. You can remove it everywhere with one PHP snippet in Code Snippets, or replace it with your own text.
The PHP snippet code
Set Code Type to PHP, then use this snippet. It removes the generator meta tag from your pages and the generator element from your RSS and Atom feeds. To show your own text instead, enter it in $generator, for example 'Built by Acme'.
use Joomla\CMS\Factory;
// Leave empty to remove the generator tag, or enter text to replace it.
$generator = '';
// Do not edit below.
$app = Factory::getApplication();
// HTML pages, including error pages: remove or replace the meta tag.
$app->registerEvent('onBeforeCompileHead', function () use ($app, $generator)
{
$app->getDocument()->setGenerator($generator);
});
// RSS and Atom feeds: remove or replace the generator element.
$app->registerEvent('onAfterRender', function () use ($app, $generator)
{
if ($app->getDocument()->getType() !== 'feed')
{
return;
}
$replacement = '';
if ($generator !== '')
{
$replacement = '<generator>' . htmlspecialchars($generator, ENT_XML1, 'UTF-8') . '</generator>';
}
$app->setBody(preg_replace('#<generator\b[^>]*>.*?</generator>#s', $replacement, $app->getBody()));
});
Joomla builds the page after PHP snippets run, so the snippet waits for the right moment. It clears the generator just before Joomla writes the page's <head>, and Joomla skips an empty generator on its own. Feeds get the same treatment just before they're sent.
How to add this snippet
- Install Code Snippets if it isn't installed already.
- Log into your Joomla backend.
- Go to Components → Tassos Code Snippets.
- Click New.
- Enter a title, for example Remove generator tag.
- Set Code Type to PHP.
- Set Insertion Method to Auto-Insert Locations.
- Set Location to On Page Load.
- Paste the code above into the editor.
- Click Save & Close.
Leave the Conditional Logic tab empty so the snippet runs on every page.
Check that it works
- Open any page of your site.
- View the page source.
- Search for
generator. It should no longer appear.
If you use Joomla's page caching, cached pages still show the old tag. Clear the cache in System → Clear Cache and check again.
Hide your Joomla version too
Joomla can also add your exact version number to the tag and to your Atom feed. Check that it's turned off:
- Log into your Joomla backend.
- Go to System → Global Configuration.
- Find Joomla Version under Metadata.
- Set it to Hide.
- Click Save & Close.
Removing the tag is a small hardening step. Joomla leaves other traces, so a determined visitor can still work out what runs your site, but the tag no longer advertises it.
To learn more about how PHP snippets work, read the PHP snippet docs.