How to Remove “View all posts filed under” Prefix from Link Title Attribute in Category Widget

Remove link prefix from categories widget in WordPress

add_filter( 'the_category', 'remove_category_link_prefix' );
add_filter( 'wp_list_categories', 'remove_category_link_prefix' );

function remove_category_link_prefix($output) {
        $replace = array( 
                'View all posts in ',
                'View all posts filed under ' 
        );

        return str_replace( $replace, '', $output);
}

Leave a Reply