Title: Shortcode content displayed above custom error message
Last modified: September 21, 2016

---

# Shortcode content displayed above custom error message

 *  Resolved [eljefejb](https://wordpress.org/support/users/eljefejb/)
 * (@eljefejb)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/shortcode-content-displayed-above-custom-error-message/)
 * I’m having the same issue reported by jshrek [here](https://wordpress.org/support/topic/shortcode-content-displaying-even-when-permission-to-user-role-blocked/).
 * I have a fresh localhost install, running the latest WordPress version with the
   default TwentySixteen theme. The only plugins are Members and the plugin that
   I’m developing. It contains a shortcode that simply displays a select list.
 * I created a new page, added the shortcode, and set the allowed roles and custom
   error message. When I view the page as a logged-out user, the shortcode content
   is displayed above the custom error message.
 * Any ideas?

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

 *  [Justin Tadlock](https://wordpress.org/support/users/greenshady/)
 * (@greenshady)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/shortcode-content-displayed-above-custom-error-message/#post-8208149)
 * See final note here: [https://codex.wordpress.org/Function_Reference/add_shortcode#Notes](https://codex.wordpress.org/Function_Reference/add_shortcode#Notes)
 *  Thread Starter [eljefejb](https://wordpress.org/support/users/eljefejb/)
 * (@eljefejb)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/shortcode-content-displayed-above-custom-error-message/#post-8208209)
 * That was it! I was sending to output instead of returning.
 * Thanks for the tip!

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

The topic ‘Shortcode content displayed above custom error message’ is closed to 
new replies.

 * ![](https://ps.w.org/members/assets/icon-256x256.png?rev=3508404)
 * [Members - Membership & User Role Editor Plugin](https://wordpress.org/plugins/members/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/members/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/members/)
 * [Active Topics](https://wordpress.org/support/plugin/members/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/members/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/members/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [eljefejb](https://wordpress.org/support/users/eljefejb/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/shortcode-content-displayed-above-custom-error-message/#post-8208209)
 * Status: resolved