Title: shortcode inside php
Last modified: November 27, 2023

---

# shortcode inside php

 *  Resolved [mcdeth](https://wordpress.org/support/users/mcdeth/)
 * (@mcdeth)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/shortcode-inside-php/)
 * hi, i’m adding some html to thank you page via plugin, is it possible somehow
   to execute shortcode from other plugin?

Viewing 1 replies (of 1 total)

 *  [polarone](https://wordpress.org/support/users/polarone/)
 * (@polarone)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/shortcode-inside-php/#post-17262812)
 *     ```wp-block-code
       <?php echo do_shortcode( '[your_shortcode]' ); ?>
       ```
   
 * But in general the question is not entirely clear.
 * You can display the shortcode via PHP – the code above.
   You can create your own
   shortcode using snippets.You can display a shortcode via PHP in a specific place
   on the site using hooks.
 *     ```wp-block-code
       add_action('HOOK', 'your_shortcode_function');
   
       function your_shortcode_function() {
           echo do_shortcode('[your_shortcode]');
       }
       ```
   
    -  This reply was modified 2 years, 6 months ago by [polarone](https://wordpress.org/support/users/polarone/).

Viewing 1 replies (of 1 total)

The topic ‘shortcode inside php’ is closed to new replies.

 * ![](https://ps.w.org/code-snippets/assets/icon.svg?rev=2148878)
 * [Code Snippets](https://wordpress.org/plugins/code-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/code-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/code-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/code-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-snippets/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [polarone](https://wordpress.org/support/users/polarone/)
 * Last activity: [2 years, 6 months ago](https://wordpress.org/support/topic/shortcode-inside-php/#post-17262812)
 * Status: resolved