Document Gallery


This plugin allows the user to effortlessly create a gallery of documents and
other attached media, much like the gallery option already available for image

Watch the following video for a brief demonstration of Document Gallery in action:

Read more in the Installation tab!


Document Gallery has to-date been translated into 6 languages, listed below.


Document Gallery includes features intended to make integration with other plugins
simple. See the bottom of the Installation tab for specific documentation on
the various features provided.

If this plugin has helped you, please take a moment to rate


  • This is how the Document Gallery looks with descriptions=false (default). Note that the display inherits styling from your active theme.
  • The common configuration options are directly accessible through the Media Manager interface, but additional configuration can be manually added to the generated shortcode.
  • This is an example of multiple Document Galleries on a single page (using the ids attribute). It also shows how images will appear in a Document Gallery. Note that the description field supports HTML markup, so the possibilities are endless!
  • Document Gallery integrates directly with the WordPress Media Manager.
  • This is an example of "fancy" thumbnails. The images are a copy of the front page for each document.


Q: I’m using taxonomies, but nothing is showing up in my gallery

A: Remember that Document Gallery defaults to retrieving just attachments for the current post/page.
If you want a broader scope of attachments, you’ll also need tell Document Gallery to search everywhere
like so: [dg id=-1 category="My Awesome Category"].

Q: Ghostscript is installed on my server, but it’s not working!

A: Document Gallery does a pretty good job of detecting where Ghostscript is installed,
but on some installs it may need a little help. To check whether this is the case,
navigate to Dashboard -> Settings -> Document Gallery and see if there is a notice
next to the Ghostscript checkbox indicating that your server is not properly configured.
If that notice does exist, the next step is to go to the Advanced tab on that same page
and see if the Ghostscript path is set. If it is not, you’ll need to manually fill it
with the location for your Ghostscript install (eg: /usr/local/bin/gs). Once that
change is saved, the Ghostscript checkbox should be enabled on the first tab.

Q: Why are all of my document icons in a single column?

A: Assuming that you do not have the columns attribute set to 1, the likely cause
of this behavior is that descriptions are enabled. To fix this, simply add descriptions=false
(eg: [dg descriptions=false]).

Q: Why is [insert thumbnail generation method] enabled on one of my WordPress installs, but not on another one?

A: Document Gallery works very hard behind the scenes to ensure that it enables
as much as is possible for any given server, but some servers just can’t do
some of the things that the plugin supports. Document Gallery detects when a
server can’t do something (run Ghostscript, for example) and disables that option.
If you later modify your server to handle one of the thumbnail generation methods,
Document Gallery will notice this and re-enable the option on the settings page,
though you will need to go in and tell Document Gallery that it should use this
newly-enabled method.

Q: Why is Ghostscript so much faster than Imagick?

A: This comes down to how the two programs work. Imagick actually delegates
handling of PDFs to Ghostscript behind the scenes, but it doesn’t do so
intelligently. Before passing off the PDF, it first reads the entire contents
of the PDF into memory. Since we only need a single page to generate the
thumbnail, this is much more work than is needed. Ghostscript, on the other hand,
can handle reading only one page into memory, thus doing much less work before
returning our thumbnail.


Incredible Plugin


One of the very top plugins I have ever used. Rock solid and easy to use. We've searched for something to manage our documents - and this exceeded our expectations. Great support too. Word class coding. Highly recommended.

Awesome support


Some days ago i ask for support that is little bit tricky, but the author is so responsive and helpful! Thankyou...

Read all 93 reviews


Features For The Future

To see a list of features planned for the future as well as to propose your own
ideas for future Document Gallery development, take a look at our
issue tracker.


  • Enhancement: WordPress 4.7 includes native support for PDF thumbnails. Document Gallery was already using some
    of this, but this update ensures that DG takes full advantage of the new core functionality, including some new
    logic to allow older WordPress installs running Document Gallery to take advantage of some of the new goodies.
  • Tested Up To: Document Gallery has been tested in WP 4.7. Big thanks to
    Bjarne for help with testing.
  • Reminder: Don’t forget that can integrate with Document Gallery to greatly
    expand supported file types (eg: Word, PowerPoint, Publisher, and Photoshop). offers a free 1-week trial
    if you want to try it before you buy it!


  • Bug Fix: Document Gallery was impossible to uninstall on some WordPress systems. This is addressed now.


  • Bug Fix: Resolves issue where visual editor gallery preview got stuck loading.


  • Tested Up To: Document Gallery has been tested in WP 4.6.
  • Bug Fix: Resolves bug in visual editor that would result in the gallery preview never loading in some circumstances.


  • Bug Fix: Ghostscript thumbnail generation where the attachment name includes non-ASCII characters was failing
    on some server configurations. Kevin Hock identified the bug AND provided the fix. Gold star!


  • Bug Fix: Ghostscript-based thumbnail generation was failing in a rare corner case. Thanks
    sigvevidnes for identifying this issue!


  • Bug Fix: There was a bug in validating user secrets for that has now been addressed.


  • Enhancement: Adding support for tax_name_include_children attribute, as requested by
    John. Thanks for the suggestion!
  • Enhancement: authentication secret is no longer output in the options
    dump on the admin settings tab, removing the possibility of this information being inadvertently printed in the
    support forum.


  • Bug Fix: The handling of saving subscriptions was broken for some use cases.
    The logic has been updated to work correctly in all cases.


  • Enhancement: HostGator users were noticing an issue where HTTP connection failures would show up while Document
    Gallery was enabled. This resulted in symptoms like not being able to update plugins. This release modifies behavior
    to try and bypass this HostGator shortcoming. Work is still being done working with HostGator to try and identify
    a more complete resolution.


  • Bug Fix: Resolves issues where the visual editor gallery preview was missing for a small subset of shortcode types.


  • Bug Fix: Resolves bug that resulted in various issues, including Jetpack and some core WordPress functionality
    not working correctly.


  • Bug Fix: Resolves drag/drop issues in the meida manager.


  • Bug Fix: Addresses issues with the IMagick thumbnail generation.
  • Enhancement: Handling thumbnail generation for image attachments better (should be faster & more reliable).


  • Bug Fix: There was a minor bug in how thumbnails for image attachments were being generated. It has been addressed.


  • Bug Fix: There was a minor issue on some admin pages that has been resolved.


  • Enhancement: Added warning to plugins page when a PHP version < 5.3 is being used.
  • Bug Fix: Resolves a “class not found” error.


  • Bug Fix: For a subset of the users upgrading from 4.0 to 4.1.x, the thumbnail images will have been corrupted
    during the upgrade process. This release addresses the problem.

4.1.1 & 4.1.2 & 4.1.3 & 4.1.4

  • Bug Fix: Resolves various errors reported following 4.1 release.


  • Enhancement: At long last, support for Microsoft Office files (Word, PowerPoint, Publisher, Visio), as well as a
    boat-load of other formats, has been re-added to Document Gallery by way of
    integration with the service. For a small fee you can generate images for all of your
    attachments using a service designed specifically to work well with Document Gallery. For a limited time, is offering a free 7-day trial of the basic subscription. If you don’t like it, all you have to do is
    cancel and you won’t pay a penny.
  • Enhancement: The pagination footer now includes more than just “prev” and “next”, allowing for quicker navigation
    of long multi-page galleries. Additionally, the pagination footer will no longer be included if pagination is enabled,
    but there are less than a page-length’s worth of attachments in the gallery.
  • Enhancement: Massive rewrite of some core logic that had become unmaintainable. This will mean nothing to most
    users, with the noted exception that if you were using the dg_thumbers filter you’ll need to change some things.
    If this applies to you then you’ll want to hold off on upgrading until you’ve had a chance to rework your usage of the
    filter to map to the new expected values.


  • Enhancement: The WordPress visual editor now displays a full gallery preview.
  • Enhancement: You can now paginate your galleries. This is especially useful in large multi-hundred item galleries.
    To enable pagination in your galleries, simply use limit=##.
  • Enhancement: All CSS & JavaScript is now served minified to ensure the fastest possible load time for your site.
  • Enhancement: When using taxonomies to generate your galleries (eg: media categories) you can now use term slug
    instead of the name. Thanks andremalenfant for suggesting this!
  • Enhancement: The structure of the gallery output has been cleaned up, making it easier to style if you chose to
    use custom CSS. NOTE: This modified structure may break existing custom CSS or PHP filtering, so be sure to check
    this if you’re using either of those features.
  • Bug Fix: The storage of the DG thumbnail cache was very broken. Due to how the cache was originally designed, it
    ran into issues at large scale and on busy sites, which resulted in difficult to track bugs. The entire storage
    mechanism for the cache has been rewritten from the ground up to address this issue, which will result in faster
    gallery generation and more reliable performance.
  • Bug Fix: In the thumbnail management tab of the DG settings, sorting by title was broken. This has been fixed.
  • Bug Fix: Limit was not working in cases where the ids or include attribute were present. This has been fixed.
  • Tested Up To: Document Gallery has been tested in WP 4.4 beta.

NOTE: All earlier changes may be found in the file.

Contributors & Developers

This is open source software. The following people have contributed to this plugin.


Browse the code