-
-
- 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
JavaScript
Add interactivity, event tracking and custom behavior to your Joomla site with JavaScript that runs exactly where you need it.
JavaScript snippets are designed for writing and running custom client-side code that enhances your site's behaviour and interactivity. Common applications include setting up analytics and event tracking, implementing cookie consent logic, adding custom form validation, building interactive UI elements, or running any JavaScript that needs to execute on page load. If you're writing the code yourself rather than loading it from an external source, this is your type.
How to Create a JavaScript Snippet
To learn how to add custom JavaScript in Joomla, follow the steps below:
- Log in to your Joomla administrator
- Go to Components → Tassos Code Snippets
- Click New
- Enter a descriptive Title (e.g. "Cookie Disclaimer")
- Select Text as the Code Type.
- Choose one of the following insertion locations
- Site Header
- Site Footer
- Admin Header
- Admin Footer
- Write or paste your JavaScript into the code editor without including
<script>tags. Your code is automatically wrapped in a<script>tag when injected at the chosen location. - Open the Conditional Logic tab to restrict which pages or users the snippet runs on. Leave it empty to run it site-wide. Learn more in Using Snippet Logic.
- Set Status to Published and click Save & Close.
Best Practices
Wait for DOM Ready
Always wait for the DOM to load before manipulating elements:
document.addEventListener('DOMContentLoaded', function() {
// Your code here
});
Troubleshooting
Script Not Executing
- Check browser console for errors (F12 → Console)
- Verify snippet is Published
- Ensure location is appropriate (Footer for DOM manipulation)
- Check conditional logic settings
- Verify no JavaScript conflicts with other scripts
Console Errors
- Check for syntax errors in your code
- Verify external dependencies are loaded
- Ensure selectors match actual elements on the page
- Check for conflicts with other scripts
Timing Issues
- Use
DOMContentLoadedor place scripts in Footer - For external dependencies, ensure they load first
- Use
deferorasyncattributes when loading external scripts
Last updated on Oct 15th 2026 12:10