Title: Shortcode in excerpt
Last modified: March 16, 2021

---

# Shortcode in excerpt

 *  Resolved [degn](https://wordpress.org/support/users/degn/)
 * (@degn)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/shortcode-in-excerpt-4/)
 * Hi
 * Im using your plugin to generate a custom layout for apartment grids, and i have
   an issue with the excerpts.
 * Is it possible to use a shortcode in the excerpt? Because i’ve created some custom
   meta boxes witch tells the amount of rooms the apratment has, the type of apartment
   and the price, and im able to export this information onto the post using a plugin
   called “Get Custom Field Values” which generates a shortcode for the specific
   meta box.
 * But when i insert the shortcode in the excerpt it just comes out as the shortcode
   text and not the actual value im looking for.
 * Im using a simple html structure for the excerpt so i can style each individual
   line.
    <p class=”lejlighed-type”>Type of apartment</p> <p class=”varelser”>How
   many rooms</p> <p class=”pris”><solid>Price</solid> Price value</p>
 * I’ve also added this line in my functions.php file but it didn’t do anything:
   
   add_filter(‘the_excerpt’, ‘do_shortcode’);
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fshortcode-in-excerpt-4%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/shortcode-in-excerpt-4/#post-14189367)
 * Hi degn
 * I’m going to have a look into this.
 * We should support the default WP behaviour, so I’ll test, and make sure we are
   aligned with that.
 * I’ll likely have an update about this later on today or tomorrow.
 * Thanks
 *  Thread Starter [degn](https://wordpress.org/support/users/degn/)
 * (@degn)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/shortcode-in-excerpt-4/#post-14190444)
 * The new update which has the custom fields integration sorted the issue. Just
   what i was looking for, thank you!
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/shortcode-in-excerpt-4/#post-14195519)
 * Hey [@degn](https://wordpress.org/support/users/degn/)
 * Glad to hear you’re setup ok.
 * I did double check this, and it looks like by default, the excerpt does not execute
   shortcodes – so we’ll be respecting that and leaving it as is.
 * However, I did find this snippet which should allow shortcodes in excerpts should
   anyone need it:
    [https://wordpress.stackexchange.com/a/42745/37783](https://wordpress.stackexchange.com/a/42745/37783)
 * Best
    – Ross
    -  This reply was modified 5 years, 2 months ago by [Code Amp](https://wordpress.org/support/users/codeamp/).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Shortcode in excerpt’ is closed to new replies.

 * ![](https://ps.w.org/custom-layouts/assets/icon-256x256.png?rev=2475457)
 * [Custom Layouts - Post + Product grids made easy](https://wordpress.org/plugins/custom-layouts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-layouts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-layouts/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-layouts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-layouts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-layouts/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Code Amp](https://wordpress.org/support/users/codeamp/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/shortcode-in-excerpt-4/#post-14195519)
 * Status: resolved