UK Sales: 0800 035 6364 | | We'll Call You

How to exclude a photo from a gallery post


A gallery will display a set of thumbnail images attached to a particular post or page. But what if you want to display an image separately in the post, but not in the gallery? Here's an example:
The problem is that Wordpress will automatically put any image that you insert in your post into the gallery as well.


The solution? Use the gallery shortcode feature to exclude specific images from the gallery. Full instructions can be found here, but for specific requirement to exclude an image from the gallery, this is what you need to add:

[gallery link="file" exclude="199"]

To add this to your post or page, switch to HTML view and look for the existing [gallery] code. Then modify it as shown.


"199" refers to the image id. This can be found from the Media menu, by hovering over the picture. The browser status bar (bottom left of window) will show 'attachment_id=xxx', where xxx is the number you want.



We understand WordPress - we've installed and use dozens of WordPress websites. Many users use Wordpress because of the ease of use and the templates and plugins options it offers - UK Wordpress Hosting from is perfect for this.


2020Media is a leading provider of small business Wi-Fi hotspots. If you want to offer free Wi-Fi to your customers or users, our service could be exactly what you are looking for. Our Hotspots are managed in the cloud, ultra-reliable and give you loads of information about behaviour patterns of your users. Read More   Read more...
2020Media introduces Moodle Hosting - UK servers and UK Moodle experts setup your site ready to use. Read more...
Special Offer for Longer Registration Periods Register or renew a .com, .net or .org domain name for 5 years we'll include 1 year free*. Read more...
2020Media is now offering zero-click installation of the popular TYPO3 content management system. Read more...

Our blog is regularly updated with news, tips and industry opinion.


  • AggieWestons
  • baker-and-mckenzie
  • arts-council-england
  • Big Finish
  • barratt-developments-logo
  • City-of-Lincoln-council-logo
  • brora-logo
  • DenisMacShane
  • Construction-Industry-Council
  • colchester