Imran
Imran

Reputation: 11654

how to remove "Archive | " from wordpress?

how do you remove "Archive | " from wordpress category page and only show the category? is there a plugin or what code do i need to remove?

Thank you in advance ;-)

Upvotes: 0

Views: 19539

Answers (6)

Patrick
Patrick

Reputation: 339

Try the filter get_the_archive_title_prefix that filters the archive title prefix. It's used by get_the_archive_title().

If you want to remove all the prefixes :

add_filter( 'get_the_archive_title_prefix', '__return_false' );

Upvotes: 0

gloslasu
gloslasu

Reputation: 1

I found an option to delete the Archive section in:

Customizing ▸ Widgets ▸ Sidebar widget area:

http://YourSite.com/wp-admin/customize.php?

screenshot

Upvotes: 0

Pons
Pons

Reputation: 1776

To remove archive pages I use to do this way: remove the archive.php page from theme (most of time it's redundant and not needed, there already are tags and categories) and then add this small code snippet in index.php page of your theme. So users that try to fetch content adding years and months to your urls are redirected to standard 404 page.

if(is_archive()) {
    // force 404
    $wp_query->set_404();
    status_header( 404 );
    nocache_headers();
    include("404.php");
    die;
}

A longer post about that here: http://www.barattalo.it/2015/09/08/wordpress-remove-archive-pages/

Upvotes: 0

Cody MacPixelface
Cody MacPixelface

Reputation: 1386

Try the WP No Category Base plugin.

It does remove the /category/ slug from your URL's, and hopefully it can also solve your question.

Upvotes: 0

maiorano84
maiorano84

Reputation: 11951

What I imagine that you mean is that there is a header tag containing "Archive | " somewhere in your category page. If you want to get rid of this string, the first thing you should look for is whether or not this can be changed somewhere in a Theme Options Page (if applicable).

If you don't have a Theme Options Page, look for "category.php" in your theme folder. Inside there, you should be able to find "Archive | " fairly easily and remove it.

DO NOT DELETE ANY FILES!! If you're having trouble, post the contents of your theme's category.php file, and I'll be sure to try and help you further.

Upvotes: 2

Anton
Anton

Reputation: 75

Try to delete archive.php in your theme's folder.

Upvotes: -2

Related Questions