Shortcodes are content, equivalent to any other text in the content. There is no way to allow one user to add a shortcode while disallowing another.
The only thing that is possible to do is to try to remove any UI the shortcodes have to “hide” it, but in the end the only true solution is to manually approve every content submitted by a non trusted user, and not to give them the option of editing it after it is approved.
The other alternative is to filter out shortcodes from the content on save. This is probably more robust, but will require some identification of the post as being one that needs the filtering, and will limit the ability of an editor user to insert shortcodes into that content when editing it.
Related Posts:
- apply_filters(‘the_content’, $content) vs do_shortcode($content)
- How to get shortcode’s input values inside a filter?
- Filter specific shortcode output?
- Insert Custom HTML After Shortcode
- Is there a way to add another row to the tinyMCE kitchen sink toggle?
- add_filter and changing output captions of image gallery
- How to add attribute to output with wp_video_shortcode add_filter
- Search content for shortcodes and get parameters
- Change default settings used by gallery shortcode
- Shortcodes not resolved in AJAX call response
- Ajax, filters and shortcodes
- Format content value from DB outside of WordPress filters
- Use content custom filter for all shortcodes
- How to link current user to their author page through shortcodes
- filter title from shortcode
- how to remove filter from wordpress shortcode output
- Error when overriding only some audio shortcode HTML output
- How to use shortcode attribute in separate function
- Shortcodes — Using add_action, add_filter in the shortcode
- How to pass variables to custom filter from multiple functions
- How to filter backend post list showing only posts having a shortcode
- How can I return shortcode output to the top of the content?
- the_excerpt filter doesn’t work as expected
- run shortcode in excerpt of single custom post type
- Filter everything from content except output of a shortcode
- Something is filtering my shortcodes… Can’t figure out what
- How to use do_shortcode_tag to modify the output of a shortcode?
- Shortcodes within the sidebar text/html widget: How to preserve the raw HTML output of the shortcode?
- How to change dynamically page title according to variable data?
- How can I filter tag_description()?
- WordPress removing slashes from shortcode output
- Shortcode / plugin with custom (flexible) output
- Filter Shortcodes when using get_page
- Parse a shortcode differently based on on what it’s nested in
- Need to return shortcode text instead of the output
- add_filter to the_content after apply_filters
- post_orderby filter breaks function
- the_content getting current page content instead specified ID
- Override wordpress audio playlist
- How to wrap pattern-matches from the_content in [wiki]-shortcode tags
- Add Index to Item in WordPress Gallery
- create a shortcode with acf including a filter
- How to take shortcode and content separately from a page?
- Auto-generated excerpt with shortcode and read more button/text link
- shortcode function outputs multiple anchor tags
- apply_filters to $GLOBALS
- Change shortcode output (filter?)
- Is it possible to include the add_filter() function within a shortcode function
- Activate short codes for all post queries?
- Problem with shortcodes in external file
- How can I display wp_link_pages before a shortcode, if it is used, or display after content?
- How to remove a filter that is an anonymous object?
- current_shortcode() – detect currently used shortcode
- No filter of code on switch from html to visual editor, how?
- How to modify posts_where filter only for the search query
- How to wrap oEmbed-embedded video in DIV tags inside the_content?
- Adding revision support to WooCommerce product content
- Changing text within the Block Editor
- How Can I Have A URL Changed Based on the Originating URL?
- Is it possible to Hook/Filters Attachment Creation?
- Apply the_title filter to post titles AND backend auto social-sharing plugin, but not nav menu
- How to hook some Unicode texts into calendar widget safely?
- Change email from and display name with a filter action
- Add Sortable Column For All Post Types
- How to change the order of HTML output of a core block?
- When to use add_action when registering/enqueuing scripts
- Is it possible to use multiple spaces in title?
- add_filter(allowed_block_types) -> adding core/paragraph bugs Gutenberg editor
- How to remove medium size class in gravity form for input tag?
- Filter out comments with certain meta key/s in the admin backend
- Custom wp_query time filter on meta_value
- get post id within add_filter()
- Modify page title and subtitle with a plugin
- Media upload default title from file name
- Use of comment_reply_link_args filter
- Error using wp_mail inside custom function
- Add/remove CRON action depending on variable
- Filter authors on meta value
- Override email_exists function
- output custom Posts on a Page
- Filter “Your latest posts”
- Hide certain product filters from specific product categories
- Add an attribute to the root from functions.php with add_filter
- Would like to use hook or filters to customize email templates
- Removing menus from users other than the administrator
- Can’t understand apply_filter logic
- Modify oembed code conditionally
- How can I add a prefix to titles displayed in sidebar using function.php?
- Modify Default URL for /wp-includes/js/wp-emoji.js?ver=4.6.1
- List all image sizes still getting disabled sizes
- wp_editor customization
- What problems could happen if I replaced add_filter and add_action with the function calling
- posts_results filter function memory errors
- Adding to an array & passing it through do_action/apply_filters
- Loading a sidebar on an Ajax call
- the_excerpt() does not work with has_excerpt()?
- Rewrite a filter as shortcode (or something like that) to use anywhere in CPT
- How do you disable the verification process of user email changes?
- Modify the third (context) parameter in a filter?
- Limit total tags in the_content