🔥 Black Friday Sale: Get 65% OFF Any PageForge Pro Plan! Use code BF65 Claim Offer →
Compte Get it free
Lightweight JS Snippet icon
Activement maintenu Testé avec WP 7.1 #31 in head

Lightweight JS Snippet

A minimal way to inject a single inline JavaScript snippet into the of one or more specific posts, pages or products. You give it a comma-separated list of post IDs and the JS body — that is the entire surface area.

Installations actives<10Nouveau
Téléchargements · 30D131▲ +8.3% vs prev. 30d
Évaluation—0 avis
Score de santé64/100Bon
Téléchargements de tous les temps1.5KSince Sep 2022
Support résolu—Aucun fil de discussion récent
A besoin deWP 5.0PHP 7.4+
Téléchargements · 7j49▲ +22.5% week over week
Notre verdict

Choix solide

Lightweight JS Snippet is a solid plugin choice in 2026, with a few things worth checking first. Was last updated 1 week ago, and scores 64/100 on our health check.

  • Développé activement — Dernière mise à jour il y a 1 semaine
  • Testé avec le dernier WordPress (7.1)
  • Petite base d'utilisateurs (<10 installations actives)
  • Très peu de critiques jusqu'à présent

Comment s'accumule-t-il ?

Côte à côte sur les installations, les mises à jour, les évaluations et le support

Téléchargements quotidiens

102131Sep 4Oct 18Dec 2
Hier4
Moyenne quotidienne (1 ans)2
Jour de pointe4223 Octobre 2026
12 Derniers mois696

Les pics de téléchargement suivent généralement une nouvelle version - chaque site qui met à jour automatiquement compte comme un téléchargement.

Classements

Where Lightweight JS Snippet stands today

WordPress.org Classements de recherche

Position en direct dans la recherche de plugins, Top 100
Mot-cléPositionPlugins concurrentsCatégorie
head >100 3,068 Best head plugins →
inline >100 8,021 Best inline plugins →
Javascript >100 10,000 Meilleurs plugins JavaScript →
poster >100 10,000 Meilleurs plugins de publication →
snippet >100 3,053 Best snippet plugins →

About Lightweight JS Snippet

From the official readme · v1.4.3

Description

A minimal way to inject a single inline JavaScript snippet into the <head> of one or more specific posts, pages or products. You give it a comma-separated list of post IDs and the JS body — that is the entire surface area.

The point is the absence of features. There is no per-post UI, no script library, no CDN selector, no “fire on event” toggle. If all you need is to drop a tracking pixel or a tiny script on three specific pages, you do not want a 2 MB plugin that wants to manage your whole site.

Set it up under Settings → Lightweight JS snippet. The page provides a textarea for the JS (no <script> tags — those are added for you) and a comma-separated list of post IDs to load it on.

Installation

  1. Upload /lightweight-js-snippet/ to the /wp-content/plugins/ directory.
  2. Activez le plugin via le menu des plugins dans WordPress.
  3. Go to Settings → Lightweight JS snippet and paste in your JS plus the post IDs.

Journal de modifications

Fixes `

1.4.3

  • Fixed: for users without the unfiltered_html capability (multisite), < in the JavaScript was saved as &lt; and broke comparisons and loops. Text that looks like an HTML tag (e.g. a<b&&c>d) is still removed for those users.

1.4.2

  • Fixed: > and & in the JavaScript were saved as &gt; and &amp;, which broke arrow functions and comparisons. Code saved earlier is repaired automatically.
  • Fixed: title search and lookup on the settings page failed on sites with plain permalinks.
  • Fixed: a </script inside the code can no longer end the script tag early.
  • The plugin’s settings are removed when it is deleted.

1.4.1

  • Fix empty <script id="jhljs-script"> tag rendered on every page when no snippet was configured. Logic error (|| where && was meant) plus no early-return on empty options.
  • Fix Settings link on the Plugins screen — previous filter targeted the wrong plugin basename, and the URL pointed at a non-existent menu slug. Both corrected.

1.4

  • Settings page now lets you pick target posts/pages by typing their title — the “comma-separated post IDs” textbox is replaced with a chip-style picker. Two small REST endpoints (jhljs/v1/posts, jhljs/v1/search) gated to manage_options power the lookup and search.

1.3

  • Sanitize the post-id list and the JS snippet on save via register_setting() callbacks (digits/commas/whitespace for the IDs, wp_kses 'data' for the script — same filter that was already applied on output).
  • Escape every translated string in the settings UI (_e()/__() → esc_html_e()/esc_html__()) and use esc_textarea() for the snippet field.
  • Add the missing License, License URI and Text Domain headers, fix the text-domain mismatches, and add an explicit version to wp_enqueue_script().
  • Bumped minimum PHP to 7.4. Tested up to WordPress 6.9.

1.2

  • Bugfix when escaping script.

Journal des modifications complet sur WordPress.org →

Captures d'écran

Settings page with code editor and post-ID list.
Settings page with code editor and post-ID list.

Pour les développeurs

Est-ce votre plugin ? Montrez les chiffres.

Ajoutez un badge en direct à votre site, docs ou github readme. Il se met à jour par lui-même - aucun compte n'est nécessaire.

Badge d'installations actives Badge Badge de score de santé

Best Lightweight JS Snippet alternatives

All head plugins →
Alternatives
Rang Plugin Installations actives Évaluation Mise à jour Santé
1 Scripts d'en-tête et de pied de page Scripts d'en-tête et de pied de page Le plugin d'en-tête et de pied de page vous permet d'ajouter des scripts aux sites WordPress et juste… par Anand Kumar 200K+ ★★★★★★★★★★ 4.6 (58) il y a 10 mois 51
2 Code de la tête et du pied de page Code de la tête et du pied de page Ajoutez un code personnalisé à l'échelle du site, de la catégorie et de l'article avant la clôture et… Par Aleksandar Urošević 100K+ ★★★★★★★★★★ 5 (51) Il y a 3 mois 71
3 Scripts au pied de page Scripts au pied de page Déplacez vos scripts vers le pied de page pour accélérer le chargement des pages perçues et améliorer les utilisateurs… Par Joshua David Nelson 7K+ ★★★★★★★★★★ 4.7 (37) il y a 1 mois 84
4 wp_head() cleaner wp_head() cleaner Remove unused tags from wp_head() output. by jwilsson 2K+ ★★★★★★★★★★ 5 (6) il y a 6 jours 83
5 HiFi (Head Injection, Foot Injection) HiFi (Head Injection, Foot Injection) HiFi is a head and foot injection plugin. It allows you to inject code into the head and… par Farinspace 2K+ ★★★★★★★★★★ 4.8 (5) il y a 16 ans 39
6 Tags to Keywords Tags to Keywords Add tags in head of page as meta's keywords by CheGevara29 200+ ★★★★★★★★★★ 5 (1) il y a 7 mois 55
7 Fix missing property app_id Fix missing property app_id This plugin inserts the fb:app_id meta property to fix the Facebook Sharing Debugger error… by iliasvlachos1 100+ ★★★★★★★★★★ 5 (2) Il y a 4 ans 32
8 Force jQuery in Head – Script Manager Force jQuery in Head – Script Manager Load jQuery in the head, choose its source, and add custom scripts to the header, footer… by Jagdish Sarma 100+ ★★★★★★★★★★ 5 (1) il y a 4 semaines 64
9 Average Head & Footer Code Average Head & Footer Code Easily add code to your head and/or footer, site-wide and/or on any individual page/post. by average.technology 100+ ★★★★★★★★★★ 5 (2) il y a 12 ans 32
10 Hide Generator Meta Tag Hide Generator Meta Tag Hides the wordpress generator meta tag from the HEAD section of your blog view source. by zafrira 90+ ★★★★★★★★★★ Aucun avis il y a 14 ans 25

FAQ

Lightweight JS Snippet: quick answers

Réponses directes, extraites des données en direct WordPress.org.

Source : WordPress.org

Is Lightweight JS Snippet free?

Yes. Lightweight JS Snippet is free to download and use from the official WordPress.org plugin directory.

Is Lightweight JS Snippet safe to use in 2026?

Lightweight JS Snippet is a solid plugin choice in 2026, with a few things worth checking first. Was last updated 1 week ago, and scores 64/100 on our health check.

How many websites use Lightweight JS Snippet?

Lightweight JS Snippet is active on <10 WordPress websites and has been downloaded 1,493 times since it launched in September 2022. It was downloaded 131 times in the last 30 days.

Does Lightweight JS Snippet work with WordPress 7.1?

Yes. The developer has tested Lightweight JS Snippet up to WordPress 7.1.5, the latest release. It requires WordPress 5.0 or newer.

What PHP version does Lightweight JS Snippet need?

Lightweight JS Snippet requires PHP 7.4 or higher. Most hosts run PHP 8.x today, so it works on any modern WordPress hosting.

When was Lightweight JS Snippet last updated?

The latest version, 1.4.3, was released on November 25, 2026 (1 week ago).

Who makes Lightweight JS Snippet?

Lightweight JS Snippet is developed and maintained by Jonas Hjalmarsson.

What are the best alternatives to Lightweight JS Snippet?

The most popular alternatives to Lightweight JS Snippet are Header and Footer Scripts (200K+ installs), Head & Footer Code (100K+ installs) and Scripts To Footer (7K+ installs).

Propulsé par PageForge

Un modèle et une feuille de calcul. Une vraie page pour chaque recherche.

PageForge transforme chaque ligne d'un CSV en une page WordPress avec son propre titre, URL, SEO et schéma, construit sur la mise en page que vous Déjà conçu. Gratuit sur WordPress.org.

  • CSV et XLSX, plus Google Sheets sur les professionnels et les entreprises
  • Son propre titre, URL, SEO champs et schéma pour chaque page
  • Fonctionne avec l'éditeur de blocs, Elementor, Divi et Avada
  • Gratuit sur WordPress.org, pas de carte de crédit

↑↓ bouger↵ ouvrir