By chance I just happened to discover what it was, so I think I’ll leave this here as it might help someone in the future.
Some web pages, including an answer to this question suggest using the following code to prevent wpautop from running until after the shortcodes. Now I wasn’t able to fully understand this code, but I had it in my functions.php and for whatever the reason it was the cause of the above.
remove_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'wpautop' , 12);
Related Posts:
- do_shortcode() doesn’t do shortcodes ;)
- Allow Shortcode in Theme Customizer
- Can I create customizer setting that can handle plugin shortcode?
- enqueue script for specific shortcode
- Why does my short code get executed before other content?
- Run shortcode before filters
- Formatting ?
- Custom shortcodes not working using __s theme
- Place the page title into the short code
- How to provide support for [gallery] shortcode?
- Responsive embed for the video shortcode
- How to display all subpages and short by year
- do_shortcode() in twentyeleven theme
- How to Manually Code Shortcode?
- wpautop on section
- Extract all shortcode data from post into loop variables?
- Shortcode IF statment help
- Extending custom shortcode to also be called directly from theme PHP pages
- Shortcode call not working in WP Template
- Shortcodes do not work in own template
- Pagination fuction in shortcode always displays on top
- How to use shortcode inside of shortcode in theme
- WordPress Shortcodes – Optional Styles
- Hide/disable sidebar using shortcode?
- wordpress script_loader_tag in function.php
- Theme does not allow shortcodes
- wordpress custom category post shortcode
- Avoiding do_shortcode() loops
- how to edit woocommerce checkout page
- How do I remove p tag *insertions*? Disabling `wpautop` removes manual tags
- TinyMCE strips content while pasting. Possibly a bug
- Passing a location-dependent array via wp_localize_script within a shortcode
- Problem using $var for shortcode attr value
- Multiple Content Shortcodes
- Onepage with shortcodes
- why my WordPress theme doesn’t support shortcode? [closed]
- Menu items description? Custom Walker for wp_nav_menu()
- Sizing screenshot.png without losing aspect ratio
- “Quick Edit” > update clears out my custom meta values
- Add default Backgrounds
- Page template in two level deep folder
- Best practices – Should I create a child theme vs. customizing a framework theme? (such as HTML5 reset)
- Worthwhile to restrict direct access of theme files?
- Use of undefined constant FS_CHMOD_DIR – assumed ‘FS_CHMOD_DIR’
- How to remove header images from all pages except the home page? skeleton theme
- Replace Home with image link inside custom header menu
- Why use while over if in single wordpress posts?
- How to set page template on front using starter content?
- Finding Page Template and Displaying Content
- how to set more than one menus to the same theme location
- Override Constants in Child theme
- How do I update WooCommerce template files in my theme? [closed]
- Theme unit test data Foreign fonts come in garbled on my machine
- How to link to theme options page from anywhere in admin?
- trying to use wp_handle_upload with ajax
- What is the best way mark entries as featured?
- How to reorganize the items returned by wp_list_comments()?
- Add new panel inside parent panel in WP Customize?
- Add theme support for post thumbnail isn’t working from theme class
- How to make wordpress theme iframe responsive
- How can I alter the display of category listings via sidebar.php?
- Need advice > converting category assignments to custom post meta values
- How to edit theme functions file to modify pagination?
- Divi – How can we show background video on mobile
- Calling post_exists() causes white screen in after_setup_theme
- Dropdown filter by custom field
- Efficiency of wp_options vs a new table
- How to properly create a child theme
- Taxonomy-$taxonomy-$term not working
- get_pages() Returns Only One Item
- How To Pick Custom Size Of Uploaded Image In Theme Via the_post_thumbnail();?
- CSS class on last post in loop ( custom query )
- add_theme_support( ‘admin-bar’ ) causes fatal error
- how to make wordpress change the title and keep page name?
- Place title (in correct place) above image with opaque background [closed]
- Fastest way to update a theme
- Load different single.php templates according to post layout selection
- Full width featured thumbnail
- How do I implement jPanelMenu?
- When trying to set title, not sure how to edit it for different pages
- Site returns a 500 Internal server error
- static front page ONLY for certain themes?
- How to add cropped custom header image?
- Changing background color depending on parent page?
- Any way to change/add to the theme name dynamically?
- Is it possible for the enqueue styles function to mess up my CSS?
- How can we stop showing short code in create or edit post section
- Alter shop page lay-out in OceanWP theme
- the_content() is getting null in Preview Debug
- Different WP Rest API custom endpoints across different themes
- How to set different localization file for different users?
- How to add an import widgets functionality to wordpress themes without a plugin
- Change site title color on individual pages
- Git ignore everything except custom theme directory
- Adding a Class to an Getting From Post Content
- Im using a right approach to use this class inside WordPress theme?
- Bestway to write php functions
- How to change order of elements using a child theme
- custom theme’s search not working
- Is there any halfway decent documentation on the wp.media JS class?