Remove shortcodes and tags from post

If the results on your search page look bloated, it’s probably because of some shorttags or tags not beeing removed. The script fixes this issue. The first line removes everything between square brackets (shortcodes) and the second one strip tags. function my_search_filter($post) { if (is_search()) { $post->post_content = preg_replace("/\[(.*?)\]/i", ”, $post->post_content); $post->post_content = strip_tags($post->post_content); }
Continue reading Remove shortcodes and tags from post

WordPress: rewrite rules

WordPress allows theme and plugin developers to programmatically specify new, custom rewrite rules. add_rewrite_rule() allows you to specify additional rewrite rules for WordPress. It is most commonly used in conjunction with add_rewrite_tag() (which allows WordPress to recognize custom post/get variables). Note that these rules are usually called inside the init hook. Furthermore, permalinks will need
Continue reading WordPress: rewrite rules