Title: &#8220;+attachment_url+&#8221; doesn&#8217;t work in shortcode
Last modified: May 7, 2021

---

# “+attachment_url+” doesn’t work in shortcode

 *  Resolved [wanderingeyedog](https://wordpress.org/support/users/wanderingeyedog/)
 * (@wanderingeyedog)
 * [5 years ago](https://wordpress.org/support/topic/attachment_url-doesnt-work-in-shortcode/)
 * I’m using the following short code to display all of my audio file attachments,
   according to their category, with the title in the caption that links to the 
   attachment page:
 * `[mla_gallery post_mime_type="audio" attachment_category="New Music" mla_caption
   ='<a href="?p={+attachment_ID+}">{+title+}</a>']`
 * This works, however it’s not SEO friendly to use the attachment ID instead of
   the permalink. Is there any way to do it with the permalink slug?
    -  This topic was modified 5 years ago by [wanderingeyedog](https://wordpress.org/support/users/wanderingeyedog/).
    -  This topic was modified 5 years ago by [wanderingeyedog](https://wordpress.org/support/users/wanderingeyedog/).
    -  This topic was modified 5 years ago by [wanderingeyedog](https://wordpress.org/support/users/wanderingeyedog/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fattachment_url-doesnt-work-in-shortcode%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [5 years ago](https://wordpress.org/support/topic/attachment_url-doesnt-work-in-shortcode/#post-14413099)
 * Thanks for your question and for including the source text of your shortcode;
   very helpful.
 * I believe you can use the `pagelink_url` parameter to get the results you seek.
   Try coding something like:
 *     ```
       [mla_gallery post_mime_type="audio" attachment_category="New Music" mla_caption='<a href="{+pagelink_url+}">{+title+}</a>']
       ```
   
 * You can find more information in the “Attachment-specific substitution parameters
   for the markup template Item part” section of the Settings/Media Library Assistant
   Documentation tab.
 * I am marking this topic resolved, but please update it if you have problems or
   further questions regarding the above suggestion. Thanks for your interest in
   the plugin.

Viewing 1 replies (of 1 total)

The topic ‘“+attachment_url+” doesn’t work in shortcode’ is closed to new replies.

 * ![](https://ps.w.org/media-library-assistant/assets/icon-256x256.png?rev=973502)
 * [Media Library Assistant](https://wordpress.org/plugins/media-library-assistant/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/media-library-assistant/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/media-library-assistant/)
 * [Active Topics](https://wordpress.org/support/plugin/media-library-assistant/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-library-assistant/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-library-assistant/reviews/)

## Tags

 * [attachment](https://wordpress.org/support/topic-tag/attachment/)
 * [caption](https://wordpress.org/support/topic-tag/caption/)
 * [link](https://wordpress.org/support/topic-tag/link/)

 * 1 reply
 * 2 participants
 * Last reply from: [David Lingren](https://wordpress.org/support/users/dglingren/)
 * Last activity: [5 years ago](https://wordpress.org/support/topic/attachment_url-doesnt-work-in-shortcode/#post-14413099)
 * Status: resolved