Skip to main content

Code Snippets for Joomla

Compatibility:   J5 j6
Extension type:   component iconplugin icon
Version:   1.1

Code Snippets for Joomla

Safely add custom PHP, JavaScript, CSS and HTML to your Joomla website

Code Snippets for Joomla is a Joomla component with a system plugin that allows you to add custom code snippets without editing template files or core files.
All snippets are managed centrally, remain update-safe, and can be enabled or disabled at any time.

Requirements

  • Joomla 4.0 or higher
  • Joomla 5 supported
  • PHP 7.4 or higher
  • Administrator access to your Joomla website

Automatic Installation

  1. Log in to your Joomla administrator panel
  2. Navigate to System → Install → Extensions
  3. Select the Upload Package File tab
  4. Click Browse and select the downloaded ZIP file
  5. Click Upload & Install
  6. The component and system plugin will be installed automatically.

Manual Installation

  1. Unzip the downloaded package on your computer
  2. Upload the folders to your Joomla installation using FTP
  3. Log in to the Joomla administrator panel
  4. Navigate to System → Discover
  5. Find Code Snippets and click Install

Enabling the Plugin

  1. Navigate to System → Manage → Plugins
  2. Find Code Snippets (System Plugin)
  3. Enable the plugin

The plugin is required to execute the snippets on the frontend.

Using Code Snippets

Creating a New Snippet

  1. Navigate to Components → Code Snippets
  2. Click New
  3. Enter a title for the snippet
  4. Select the snippet type
  5. Add your code
  6. Set the snippet to Enabled
  7. Save the snippet

The snippet is now active on your website.

Snippet Types

PHP Snippets

Use PHP snippets for custom logic, filters, or small functional additions.

  • Executed during Joomla’s lifecycle
  • Intended for developers or advanced users
  • Errors in PHP code can affect the site

Always test PHP snippets carefully.

JavaScript Snippets

Use JavaScript snippets to add tracking scripts, custom behavior, or third-party integrations.

Typical use cases:

  • Google Analytics
  • Custom frontend interactions
  • External script injections

CSS Snippets

Use CSS snippets for global styling changes.

Examples:

  • Override template styles
  • Add small layout fixes
  • Apply custom branding
  • CSS snippets are loaded automatically on the frontend.

HTML Snippets

Use HTML snippets for static markup or verification tags.

Examples:

  • Meta verification tags
  • Inline HTML blocks
  • Custom markup injections

Enabling and Disabling Snippets

Each snippet can be enabled or disabled individually.

  • Disabled snippets are not loaded
  • Snippets remain stored and editable
  • Useful for testing or temporary changes

How It Works

  1. You create a snippet in the component
  2. The snippet is stored in the database
  3. The system plugin loads enabled snippets
  4. Code is injected without modifying templates
  5. Joomla updates do not affect your snippets

Google Analytics Example

To add Google Analytics:

  1. Create a new JavaScript or HTML snippet
  2. Paste the tracking code provided by Google
  3. Enable the snippet
  4. Save

No template editing is required.

Compatibility

  • Joomla 4
  • Joomla 5
  • Joomla 6
  • Compatible with all templates
  • Works with YOOtheme Pro
  • Safe to use with caching and performance extensions

Subscription and Usage

You can continue using Code Snippets after your subscription ends.
An active subscription is required only for updates and support.

Order Now

Unlimited Websites

€ 19,99
  • Support for a single website.
  • 12 months of support.
  • 12 months of access to downloads.