Title: Custom shortcode content into form
Last modified: January 9, 2025

---

# Custom shortcode content into form

 *  [Padaben](https://wordpress.org/support/users/padaben/)
 * (@padaben)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/custom-shortcode-content-into-form/)
 * Hi, thank you for the plugin, again 😀
   I did create a function in my child theme
   to randomly display a question for the textarea to be used as response.but the
   last ] of the shortcode is closing the field in output and so it does not work.
   I did add
 *     ```wp-block-code
       function mycustom_wpcf7_form_elements( $form ) {	$form = do_shortcode( $form );	return $form;}add_filter( 'wpcf7_form_elements', 'mycustom_wpcf7_form_elements' );
       ```
   
 * then I created my normal shortcode [ab_testing_phrase], and added this to the
   form :
 *     ```wp-block-code
       <label style="text-align:left;width:100%;">[textarea textarea-75 “[ab_testing_phrase]”]</label>and I also tried this, but the syntax doesn't seems to work any more even without shortcode in.<label style="text-align:left;width:100%;>[textarea textarea-75] [ab_testing_phrase][/textarea]</label>
       ```
   
 * if I display the [ab_testing_phrase] out of textarea I have it 
   if I add it to
   a text or hidden field, same, doesn’t workthank you for your reponse 😀 best 
   for 2025
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcustom-shortcode-content-into-form%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

The topic ‘Custom shortcode content into form’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Padaben](https://wordpress.org/support/users/padaben/)
 * Last activity: [1 year, 5 months ago](https://wordpress.org/support/topic/custom-shortcode-content-into-form/)
 * Status: not resolved