I used remove_shortcode(‘gallery’); …the gallery is gone, but the shortcode is visible in the text. How do I remove sitewide? I’ve searched for sql queries, but no solution fixes my specific problem.
Leave a Reply
You must be logged in to post a comment.
The short code is actually entered into then page or post content so disabling the short code processing prevents the gallery short code from being replaced with the gallery images but it doesn’t affect the post content.
The best solution is to add a new short code handler after removing the default gallery handles. Another less desirable approach would be to remove the short code tag from all posts and pages.
Short code replacement would look something like this:
You can make it invisible with a simple trick:
This will remove the code from output without touching the post content.
The empty shortcode is a very nice trick, but if you want to remove the string
[gallery]
from all posts, there are two options: manually in the dashboard or a database search/replace.Although the database could be manipulated directly, in those cases (content replacement), I prefer to use the plugin Search and Replace, by Frank Bültge.
As any database manipulation, backing up is essential.