When going through various themes and plugins, you might use various shortcodes on your site or on a client site. When making the transition from one theme to another or from one plugin to another something might happen. You could forget a page or post where you have used a shortcode. Such unused shortcode could break your site. Let’s see how to find those pages and posts. How to find Unusued Shortcode You can go to each post, page or any other custom post type and see which shortcode was not parsed into a styled text, form or something else. We are not doing that! But we will do that through our code. We will have to parse all the content so that every possible shortcode that is registered gets parsed. With that approach, we will be left only with the shortcodes that once were registered (by a deactivated plugin or theme). Coding our Search Engine Our seach engine for unused shortcodes will be done on the admin side. You can add this code as a separate plugin or in your own existing plugin or theme. That is up to you. Let’s begin: <?php add_action( 'admin_init', 'ibenic_get_all_posts_shortcodes' ); function ibenic_get_all_posts_shortcodes() { if( isset( $_REQUEST['get_shortcodes']
Share This

We are using cookies on our website

Please confirm, if you accept our tracking cookies. You can also decline the tracking, so you can continue to visit our website without any data sent to third party services.