-
-
- 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
Why your PHP snippet isn't running
A checklist for a PHP snippet that does nothing in Joomla: status, location, conditions, access level, timing, cache, and the errors that disable it.
A PHP snippet that does nothing is almost always one of 9 things. Work through this list from the top; the first 3 catch most cases.
1. The snippet isn't published
Open Components → Tassos Code Snippets and check the Status column. Auto-Disabled means the snippet failed and Code Snippets switched it off: open it, read the error at the top of the edit screen, fix the code and publish it again. How to debug PHP errors in a snippet covers the common errors.
2. The Location doesn't match where you're looking
The Location of a PHP snippet picks the client it runs in:
- Site Page Load runs on the frontend only.
- Admin Page Load runs in the administrator only.
- Site and Admin Page Load runs in both.
A snippet on Site Page Load never runs while you click around the administrator, and the other way round. The 2 admin locations are part of Code Snippets Pro.
3. A condition or the access level hides it
Open the Conditional Logic tab and check every rule. A condition that doesn't match the current page skips the snippet without any error. Then check Access in the sidebar: Code Snippets only loads the snippets the current visitor is allowed to view. A snippet that must react to a login, on the site or in the administrator, has to stay Public, because the login request comes from a guest.
4. The system plugin is disabled
Go to System → Plugins and search for Tassos Code Snippets. The System - Tassos Code Snippets plugin is what runs the snippets. With it disabled, the component still saves them but none of them execute.
5. Safe mode is on
If someone added tcs_safe_mode to configuration.php to recover from a broken snippet, every snippet is paused until that line goes. The component's pages show a warning while it's on. See Use safe mode to recover from a snippet that locks you out.
6. The output goes nowhere useful
Page Load snippets run during onAfterRoute, before Joomla has built the page. Anything they echo is printed before the page's HTML, where it breaks the markup instead of showing a message. To show something, queue a message:
use Joomla\CMS\Factory;
Factory::getApplication()->enqueueMessage('The snippet ran', 'notice');
Output only matters for the Shortcode insertion method, where what the snippet echoes or returns replaces the shortcode. Shortcodes are replaced on the frontend only.
7. The code runs too early
At onAfterRoute the document isn't built yet and the article text isn't loaded, so code that touches the page has nothing to work with. Wrap it in a later event, as the Example section of the PHP snippet docs shows: onBeforeCompileHead for the page head, onAfterRender for the final output, onContentPrepare for article text.
8. The code uses a blocked function
Snippets that contain exec, eval, fopen and a few other functions never execute. The full list is in the PHP snippet docs under Security Considerations.
9. A cached page is served
With System - Page Cache enabled, visitors may get a stored copy of the page, so a snippet that changes the output seems to do nothing. Clear the cache under System → Clear Cache and reload.
Still stuck? Put the enqueueMessage line from point 6 at the top of the snippet. If the message appears, the snippet runs and the problem is in the code below it. If it doesn't, one of the first 5 points is the cause.