Title: Alter Default Gallery Shortcode
Last modified: August 20, 2016

---

# Alter Default Gallery Shortcode

 *  [beingnickb](https://wordpress.org/support/users/beingnickb/)
 * (@beingnickb)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/alter-default-gallery-shortcode/)
 * I am having difficulty figuring out how to alter the shortcode WordPress inserts
   as part of its default gallery functionality. The shortcode being generated looks
   like this:
 * [gallery ids="1,2,3,4"] where the numbers are image ids.
 * I would like it to automatically add link=”file” so that it looks like this:
 * [gallery link="file" ids="1,2,3,4"]
 * Where is the code I should edit and what exactly should I be editing?

The topic ‘Alter Default Gallery Shortcode’ is closed to new replies.

## Tags

 * [gallery](https://wordpress.org/support/topic-tag/gallery/)
 * [Short Code](https://wordpress.org/support/topic-tag/short-code/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [beingnickb](https://wordpress.org/support/users/beingnickb/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/alter-default-gallery-shortcode/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
