Remove Category Name From WordPress Post

You might be think it will be better to see your website than it display without category title in blog page or category page of your WordPress website, if you are using WordPress. It is very easy thing to remove category name from the blog post or category page. Let’s see how can we do this.

functions.php

function.php file will help us to achieve this. So, locate the functions.php file in your wordpress installation directory either by cPanel then File Manager option or direct access through ftp clients like filezila. Locate it as below

htdocs\your-site-name\wp-includes\functions.php
open the file and add below code at the end, save and exit and see the changes.
function prefix_category_title( $title ) {
    if ( is_category() ) {
        $title = single_cat_title( '', false );
    }
    return $title;
}
add_filter( 'get_the_archive_title', 'prefix_category_title' );

Post a Comment

Previous Post Next Post