Title: Simple Lightbox for WordPress
Author: Martin von Berg
Published: <strong>26 april 2022</strong>
Last modified: 11 december 2025

---

Plugins zoeken

![](https://ps.w.org/simple-lightbox-fslight/assets/banner-772x250.png?rev=2715006)

![](https://ps.w.org/simple-lightbox-fslight/assets/icon.svg?rev=2715006)

# Simple Lightbox for WordPress

 Door [Martin von Berg](https://profiles.wordpress.org/martinvonberg/)

[Download](https://downloads.wordpress.org/plugin/simple-lightbox-fslight.3.2.0.zip)

 * [Details](https://nl.wordpress.org/plugins/simple-lightbox-fslight/#description)
 * [Beoordelingen](https://nl.wordpress.org/plugins/simple-lightbox-fslight/#reviews)
 * [Ontwikkeling](https://nl.wordpress.org/plugins/simple-lightbox-fslight/#developers)

 [Ondersteuning](https://wordpress.org/support/plugin/simple-lightbox-fslight/)

## Beschrijving

** !!! Upgrade only if your server uses PHP 8.0++. Do NOT upgrade if it still uses
PHP 7.4. !!! **

Provides an easy was to add a Lightbox to Images in Gutenberg image, gallery and
Media-with-Text-Blocks. Additionally to Youtube and HTML5 Videos but no other videos.
Other video types like VideoPress, Vimeo etc. are currently NOT supported.
 The 
Javascript library fslightbox.js is used for that. You even may use the paid version
of fslightbox.js. Plugin settings are provided by a JSON-file that may be easily
changed and backed-up manually (automatically after V2.0.0).

NEW: Added support for the complete HTML-code to the post, page etc. in-between 
body tags and not only the content. This is an Opt-in. See example settings file
in ./settings/plugin-settings-body.json.

The support for HTML5-Videos and Youtube-Videos will add a small red button on the
top left of the embedded Youtube-Video which opens the lightbox with that video.

YT-Videos could be disabled by deleting the line `"wp-block-embed-youtube"` in the
file `plugin-settings.json`. If you do so please delete the comma at the end of 
the line before, too! See live example here: https://www.berg-reise-foto.de/software-
wordpress-lightroom-plugins/wordpress-plugins-fotos-und-karten/

The support for Youtube-Videos is working with the given functionality and extended
to stop running videos onOpen and for the paid version to stop running videos on
slideChange.

### Plugin uses

Following libraries and WP-Plugins were used to create this plugin:

 1. [fslightbox.js](https://fslightbox.com/)
 2. [HTML5DOMDocument by ivopetkov](https://github.com/ivopetkov/html5-dom-document-php)
 3. [Lightbox Gallery by Kodefix](https://wordpress.org/plugins/kodefix-lightbox-gallery/)

## Schermafbeeldingen

 * [[
 * Example lightbox.

## FAQ

### How does the plugin work?

Plugin is filtering the content of posts and pages and appends lightbox effect for
native Gutenberg-Blocks: Image, Gallery, Media-and-Text, Featured Image, Video and
Youtube-Video. It also works for external images or YT-videos that are not on your
site.

### What exactly are the preconditions?

 * It filters the content of the page, post etc (setting: postTypes). Meaning exactly
   the content that WP stores in the database as content for posts, pages etc. (
   Using the_content filter)
 * All elements in html figure tags and img tags will be filtered and if its CSS-
   Class is defined in the plugin-settings.json (setting: cssClassesToSearch).

### Will it work with my page builder, Theme, ACF etc.?

Maybe, see preconditions above. If your theme provides output that is NOT stored
as content in the database it will not work. If your media ( be it image or video)
is not given in a figure tag it will not work.
 Positive feedback is reported from
Beaver Builder, Post Types of Advanced Custom Fields. Negative feedback is given
by GeneratePress that generates page content in special elements by the theme files.
So, just try if it works and mind the preconditions.

### How to change the plugin settings?

The settings are stored in a separate file called plugin-settings.json, located 
in the main plugin folder.
 In this file, you can: * **postTypes** – Define which
post or page types or other should include the lightbox. * **hrefTypes** – Choose
which link type may already be present on the image (`Empty`, `Media`). * **cssClassesToSearch**–
Specify CSS classes used for images or videos to apply the lightbox. Mind: These
are defined in the figure-Tag above the img-tag! Predefined classes are: “wp-block-
image”, “wp-block-post-featured-image”, “wp-block-embed-youtube”, “wp-block-media-
text__media”, “wp-block-video” Not working with : “wp-block-cover” * **excludeIDs**–
List post or page WordPress-IDs that should not include a lightbox. * **rewriteScope**–
Select where HTML rendering takes place: * ” – Empty Value: Default or standard 
setting to render the content only. * `body` – Render in PHP for the entire page.*`
javascript` – Render on the client side for the entire script.

Default settings are optimized for most use cases, so you usually don’t need to 
change them initially.

### Is the paid version of fslightbox.js supported?

Yes, you may buy the fslightbox.js an add the file fslightbox.js to the folder ./
folder-where-the-plugin-is-installed/js/fslightbox-paid. That’s it.

### Does the plugin have any requirements?

No. You can use this plugin with pure WordPress with Gutenberg editor enabled. But
mind the preconditions above.

### Is the lightbox responsive?

Yes. Lightbox is fully responsive – it scales to every device.

### Does the plugin use jQuery?

No. Plugin just uses fslightbox.js. Free or paid version optionally.

### Does the plugin backup and restore my plugin-settings.json and my paid Version of fslightbox?

Yes, the Update to 2.0.0 implements a backup / restore logic for `plugin-settings.
json` and the files in ./js/fslightbox-paid. This will work ONLY for all future 
updates because the php-files have to be on your server already. So, with this update
it is the last time you have to save your files in advance. The process creates 
the folder `../simple-lightbox-fslight-backup` in you Plugin-Directory which won’t
be deleted after Update. If you want the backup-restore process running with the
Update to V2.0.0 you have to manually copy the files `simple-lightbox-fslight.php`
and `./admin/pre-post-install.php` from Github via ftp to your server. The backup/
restore logic won’t work if you install the Plugin manually as zip-File.

### With Youtube-Videos the Browser Console shows Javascript Errors. Is it a Problem?

Yes, there are errors shown like “The service worker navigation preload request 
was cancelled before ‘preloadResponse’ settled. If you intend to use ‘preloadResponse’,
use waitUntil() or respondWith() to wait for the promise to settle”. This issue 
is not solvable by me. If you dislike it: Just delete the JS-File `simple-lightbox.
min.js`. The Video Sync will no longer work after that.

### Why does it not work with flickr images?

You might add “wp-block-embed-flickr” but the lightbox does not open? That is, because
flickr image blocks contain a link to the image on the flickr website. The Gutenberg
block does not have an option to change this. The plugin functionality does NOT 
change existing links, because this is usually intentionally.

### Why does it not work with featured images?

Featured images are not stored in the database as content. The plugin does usuallay
not filter the content of post, page etc. So, add the option “rewriteScope”: “body”
to the settings.json file. See example settings file in ./settings/plugin-settings-
body.json.

### Does it work with AVIF image format?

Yes, it does!

## Beoordelingen

![](https://secure.gravatar.com/avatar/fb97c189dd05c185488b0ac4a23d5af73420bf6fa115cb40d692beef644f9adf?
s=60&d=retro&r=g)

### 󠀁[Breaks my website](https://wordpress.org/support/topic/preserve-json-file-modifications-after-plugin-updates/)󠁿

 [bastienchilloux](https://profiles.wordpress.org/bastienchilloux/) 19 maart 2026
1 reactie

Worked well until this plugin disable all my independent Vimeo embedded links and
my image galeries. Rolling back to previous WordPress version or plugin version 
don’t solve the issue.Update: issue fixed by replacing this plugin with another 
one.

![](https://secure.gravatar.com/avatar/1fe3ce8bb8af6b77e0484e28c7b724d2a27a78392a0c71edb9481ea75eb6f532?
s=60&d=retro&r=g)

### 󠀁[The Perfect WP plugin for fsLightbox.js](https://wordpress.org/support/topic/the-perfect-wp-plugin-for-fslightbox-js/)󠁿

 [electricwatches](https://profiles.wordpress.org/electricwatches/) 9 juni 2025

I’ve been trying many different Lightbox Plugins over the last 3-4 years, some of
them quite good and some awful ones. But none of them quite had what I was looking
for. But have tried this one, coupled with the Basic (free) fsLightbox.js that came
with it, it was clear this was the one for me and I immediately upgraded to the 
Pro version of fsLightbox.js. Try it, you won’t be disappointed.

![](https://secure.gravatar.com/avatar/a046a63148ebd6eabba391d2234a289ee6034f9762a4d11fa684340e2ab48b3f?
s=60&d=retro&r=g)

### 󠀁[Excelente, simples e poderoso.](https://wordpress.org/support/topic/excelente-simples-e-poderoso/)󠁿

 [PTPAC](https://profiles.wordpress.org/ptpac/) 14 april 2025

Na perspetiva de programador, claro.Para utilizadores com menos skills pode ser 
complicado na medida em que envolve algumas configurações em casos especiais como
temas e custom post_types.Recomendo a leitura atenta aos conteúdos do readme, descrições
e suporte.Abraço, PPR

![](https://secure.gravatar.com/avatar/2f26bfbd19c3a545909e0e091ad1ebe0b4881eb83ddb5a39df9189e3018d27b5?
s=60&d=retro&r=g)

### 󠀁[Great Functionality, Responsive & Supportive Developer](https://wordpress.org/support/topic/great-functionality-responsive-supportive-developer/)󠁿

 [Michael Goitein](https://profiles.wordpress.org/mgoitein/) 5 november 2023

I had a small issue that was killing one page on my site due to some plugin incompatibilities,
and Martin, the developer, jumped in and had a fix in a matter of days. Very supportive&
responsive throughout the process. Highly recommended. MG

![](https://secure.gravatar.com/avatar/a38b1291179592ff2855a07f57d7fe0e9bd8a0cd9970172527583a936cb1b4cd?
s=60&d=retro&r=g)

### 󠀁[Does what it says](https://wordpress.org/support/topic/does-what-it-says-1158/)󠁿

 [Josh](https://profiles.wordpress.org/joshspires/) 19 september 2023 3 reacties

This plugin does exactly what it says without adding any unwanted fluff to the webpage.
One thing that would be good, would be to allow settings to be stored across updates.
This isn’t a massive problem as I’ve turned off auto updates. It is worth noting
the file is called plugin-settings.json instead of settings.json, as mentioned in
the description.

![](https://secure.gravatar.com/avatar/a2dd6eb715580c2b6afbd2e7fe0736846a0cd88525fa03d820b1235d02389f4a?
s=60&d=retro&r=g)

### 󠀁[Simple, lightweight and extremely useful! A perfect lightbox plugin!](https://wordpress.org/support/topic/simple-lightweight-and-extremely-useful-a-perfect-lightbox-plugin/)󠁿

 [David Ha](https://profiles.wordpress.org/hathaihaojp/) 1 augustus 2023

This is the perfect and best plugin for WordPress using the Lightbox library! I 
want to give you my sincere thanks!

 [ Lees alle 10 beoordelingen ](https://wordpress.org/support/plugin/simple-lightbox-fslight/reviews/)

## Bijdragers & ontwikkelaars

“Simple Lightbox for WordPress” is open source software. De volgende personen hebben
bijgedragen aan deze plugin.

Bijdragers

 *   [ Martin von Berg ](https://profiles.wordpress.org/martinvonberg/)

[Vertaal “Simple Lightbox for WordPress” in je eigen taal.](https://translate.wordpress.org/projects/wp-plugins/simple-lightbox-fslight)

### Interesse in ontwikkeling?

[Bekijk de code](https://plugins.trac.wordpress.org/browser/simple-lightbox-fslight/),
haal de [SVN repository](https://plugins.svn.wordpress.org/simple-lightbox-fslight/)
op, of abonneer je op het [ontwikkellog](https://plugins.trac.wordpress.org/log/simple-lightbox-fslight/)
via [RSS](https://plugins.trac.wordpress.org/log/simple-lightbox-fslight/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 3.2.0

 * Added functionality to render the HTML for fslightbox completely on the client
   side in javascript. Almost same performance for images from the same server. 
   Slower for videos from another source.
 * Added the requred *.js and *.css files for that. Tested with local and public
   version of my sites.

#### 3.1.0

 * Updated Class in RewriteFigureTagsClass.php for ’the_content’ and ‘body’ HTML-
   filter to improve
    - restriction to frontend page calls ( function prepare(), changeFigureTagsInContent)
      and early stop if no figures or images are on the page, post etc.
    - guarantee that the html-code is treated only once (html comment and counter)
    - function my_enqueue_script upated for paths and logic
    - error treatment in function parentFindCssClass().
    - loading of html from dom changed with wrapper to prevent adding of body, head
      etc. tags
    - new function to get the mime type faster and better: hrefImageDetection.php
    - updated Unit-Tests accordingly.
    - Update Generation of Thumbnails for Youtube-Videos

#### 3.0.0

 * Updated PHP-Lib html5-dom-document-php to V2.8.1 which requires PHP 8.* so increased
   the min PHP Version to 8.0.
 * Update of fslightbox.js (basic, free version) to 3.7.4. and pro to 3.8.3.
 * Test with WP 6.9.0. Updated files for PHPUnit-Tests. All Tests ran OK.

#### 2.2.0

 * Update of fslightbox.js (basic, free version) to 3.6.0. and pro to 3.8.0.
 * Tested basic and pro with WP 6.8. No Changes.

#### V2.1.1

 * Tested with WP 6.7. No Changes. Tested with AVIF-Images: Works!

#### V2.1.1

 * Tested with WP 6.6. No Changes. Tested with AVIF-Images: Works!

#### V2.1.1

 * BUGFIX: PHP Bugfixes to avoid incomplete script tag together with rewritescope:
   body

#### V2.1.0

 * BUGFIX: PHP Bugfixes to avoid crashes for unsupported media types.

#### V2.0.0

Breaking Changes:
 – NEW: Minimum PHP Version is now 7.4 – NEW: added an option 
to handle the complete HTML code in-between the Body tags (not only the_content)–
NEW: for WP 6.4: Do not open the lightbox where the new WP lightbox was activated.–
BUGFIX: changed process for backup and restore of plugin files. V1.5.0 did not work
in all cases and caused PHP fatal errors in some cases. – BUGFIX: changed code for
HTML5Videos to be compatible with W3C standards. Will add a Button Icon on the Top
Left. – – removed handling of Postie-images (was my private use) – Code Refactoring
of Main Class – Updated JS to pause Videos on Slide change (only paid version of
fsligthbox will support this) – Updated PHPDocBlocks for PHPUnit Tests, PHPStan 
Level 6 and PHPCS

#### 1.5.0

Added JS to pause all running videos on Open of lightbox and pause current video
on slide change (paid version, only).
 Added backup / restore logic for plugin-settings.
json and fslightbox-paid files.

#### 1.4.0

Added support for Youtube-Videos. (The access to the YT-JS-API is not feasible for
me to CORS-Policy, so the trial to sync the running videos was stopped.)

#### 1.3.3

Some changes for WPCS rules and code reformatting. No functional change. Updated
HTML5DOMDocument.php from github.
 Test with WordPress 6.3. Save and Restore function
for settings before Update not realized. Save your settings before update.

#### 1.3.2

Added PHP type definitions.

#### 1.3.1

Added an aria-label to the button for accessibility and lighthouse tests. Updated
Unit-Tests successfully. No functional change.

#### 1.3.0

Update of fslightbox.js (basic, free version) to 3.4.1. Download from: https://fslightbox.
com/fslightbox/javascript/fslightbox-basic-3.4.1.zip
 Test with WP 6.2.

#### 1.2.0

Test with WP 6.1. No changes.

#### 1.1.1

Test with WP 6.0. No changes.

#### 1.1.0

Added a Setting to exclude certain IDs (post or page or whatever is set)
 Included
the Preview (‘poster’) of videos in the thumbnails (only paid version will see thumbnails)
Included a logic for old Gutenberg images with div-tag figure-tag img-tag… structure
where the class is defined in the div. Bugfixes: Corrected the generated html for
Media-Text and for images with a link in their caption

#### 1.0.0

First Version based on Lightbox Gallery by Kodefix.

## Meta

 *  Versie **3.2.0**
 *  Laatst geüpdatet **5 maanden geleden**
 *  Actieve installaties **400+**
 *  WordPress versie ** 5.9 of nieuwer **
 *  Getest t/m **6.9.4**
 *  PHP versie ** 8.0 of nieuwer **
 *  Taal
 * [English (US)](https://wordpress.org/plugins/simple-lightbox-fslight/)
 * Tags
 * [gallery](https://nl.wordpress.org/plugins/tags/gallery/)[gutenberg](https://nl.wordpress.org/plugins/tags/gutenberg/)
   [lightbox](https://nl.wordpress.org/plugins/tags/lightbox/)[video](https://nl.wordpress.org/plugins/tags/video/)
 *  [Geavanceerde weergave](https://nl.wordpress.org/plugins/simple-lightbox-fslight/advanced/)

## Waarderingen

 5 van 5 sterren.

 *  [  10 5 sterren beoordelingen     ](https://wordpress.org/support/plugin/simple-lightbox-fslight/reviews/?filter=5)
 *  [  0 4 sterren beoordelingen     ](https://wordpress.org/support/plugin/simple-lightbox-fslight/reviews/?filter=4)
 *  [  0 3 sterren beoordelingen     ](https://wordpress.org/support/plugin/simple-lightbox-fslight/reviews/?filter=3)
 *  [  0 2 sterren beoordelingen     ](https://wordpress.org/support/plugin/simple-lightbox-fslight/reviews/?filter=2)
 *  [  0 1 sterren beoordelingen     ](https://wordpress.org/support/plugin/simple-lightbox-fslight/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/simple-lightbox-fslight/reviews/#new-post)

[Bekijk alle beoordelingen](https://wordpress.org/support/plugin/simple-lightbox-fslight/reviews/)

## Bijdragers

 *   [ Martin von Berg ](https://profiles.wordpress.org/martinvonberg/)

## Ondersteuning

Iets te melden? Hulp nodig?

 [Het supportforum bekijken](https://wordpress.org/support/plugin/simple-lightbox-fslight/)

## Doneren

Wil je de groei van deze plugin ondersteunen?

 [ Doneer aan deze plugin ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CQA6XZ7LUMBJQ)