[wp-trac] [WordPress Trac] #25644: strip_shortcodes always removes text between shortcode tags, should be optional

WordPress Trac noreply at wordpress.org
Mon Jul 21 14:01:58 UTC 2025


#25644: strip_shortcodes always removes text between shortcode tags, should be
optional
------------------------------------+---------------------
 Reporter:  jonscaife               |       Owner:  (none)
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:
Component:  Shortcodes              |     Version:  3.6.1
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:
------------------------------------+---------------------

Comment (by callumbw95):

 Hi All,

 I have just taken a look into this, and this issue still appears to occur.
 I also cannot think of any reason why this bug would be intentional, and
 as of such I have attached a bug report below to help gain some traction
 on this issue.

 == Bug Report
 === Description
 `strip_shortcodes()` is still removing content within shortcodes in passed
 content.

 === Environment
 - WordPress: 6.9-alpha-60093-src
 - PHP: 8.4.7
 - Server: nginx/1.27.5
 - Database: mysqli (Server: 8.0.40 / Client: mysqlnd 8.4.7)
 - Browser: Chrome 137.0.0.0
 - OS: macOS
 - Theme: Twenty Seventeen 3.9
 - MU Plugins: None activated
 - Plugins:
   * Test Reports 1.2.0

 === Steps to Reproduce
 1. Pass a string to `strip_shortcodes()` including a shortcode. For
 example: `Lorem ipsum [caption]dolor[/caption] sit amet, consectetur
 adipisicing elit`.

 === Expected Results
 1.  ✅ Output string should be: `Lorem ipsum dolor sit amet, consectetur
 adipisicing elit`

 === Actual Results
 1.  ❌ Output string is actually: `Lorem ipsum sit amet, consectetur
 adipisicing elit`

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/25644#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list