Möchten Sie das Basispräfix der Kategorie in WordPress ändern?
Standardmäßig fügt WordPress automatisch /category/ als Präfix zu URLs für alle Kategorieseiten hinzu. Sie können das Basispräfix der Kategorie jedoch leicht ändern oder ganz entfernen.
In diesem Artikel zeigen wir Ihnen, wie Sie das Basispräfix der Kategorie in WordPress ändern können.
Was ist das Basispräfix der Kategorie? Sollten Sie es ändern?
Jede Kategorie auf Ihrer WordPress-Website erhält eine eigene Seite und einen eigenen RSS-Feed. Sie können alle Beiträge, die unter einer Kategorie abgelegt sind, auf der Archivseite dieser Kategorie einsehen.
Standardmäßig fügt WordPress den URLs für Kategorieseiten das Präfix „Kategorie“ hinzu. Dies hilft bei der Unterscheidung von Seiten und Beiträgen von Kategorie- und Tag-Archiven.
Wenn Sie zum Beispiel eine Kategorie mit dem Namen „Nachrichten“ haben, sieht ihre URL wie folgt aus:
http://example.com/category/news/
In ähnlicher Weise fügt WordPress auch Tag-Präfixe zu URLs für Tag-Archive hinzu.
http://example.com/tag/iphone/
Diese SEO-freundliche URL-Struktur hilft Nutzern und Suchmaschinen zu verstehen, welche Art von Seite sie besuchen.
Für die meisten Websites ist es nicht erforderlich, das Basispräfix zu ändern. Wenn Sie jedoch eine Nischenseite erstellen, auf der Sie ein anderes Wort oder einen anderen Satz für Ihre Kategorien verwenden möchten, können Sie das Basispräfix der Kategorie entsprechend ändern.
Ändern des Basispräfixes der Kategorie in WordPress
Das Ändern des Basispräfixes der Kategorie ist in WordPress recht einfach.
Besuchen Sie die Seite Einstellungen “ Permalinks in Ihrem WordPress-Dashboard und scrollen Sie nach unten zum Abschnitt „Optional“.
In das Feld „Kategoriebasis“ können Sie das Präfix eingeben, das Sie neben der Option „Kategoriebasis“ verwenden möchten. Sie können auch das Präfix für die Tag-Basis ändern, wenn Sie möchten.
Sie können zum Beispiel „topics“ als neues Präfix hinzufügen. In diesem Fall werden Ihre Kategorie-URLs wie folgt aussehen:
http://example.com/topics/news/
Vergessen Sie nicht, auf die Schaltfläche „Änderungen speichern“ zu klicken, um Ihre Einstellungen zu speichern.
Entfernen des Kategorie-Basis-Präfixes aus URLs
Viele unserer Nutzer haben uns gefragt, ob wir das Präfix für die Kategoriebasis aus den WordPress-URLs entfernen können. Dadurch werden Ihre Kategorie-URLs wie folgt aussehen:
http://example.com/news/
Dies ist keine gute Idee, und wir empfehlen, dass Sie das Präfix für die Kategoriebasis nicht entfernen.
Das Präfix für die Kategoriebasis hilft sowohl Benutzern als auch Suchmaschinen, zwischen Beiträgen/Seiten und Kategorien zu unterscheiden. Das Entfernen des Präfixes macht Ihre URLs mehrdeutig, was nicht gut für die Benutzerfreundlichkeit oder die SEO von WordPress ist.
Sie können auch auf technische Probleme mit verschiedenen WordPress-Plugins stoßen. Wenn Sie z. B. eine Kategorie und eine Seite mit demselben Namen haben oder wenn Sie %postname% als URL-Struktur für einzelne Beiträge verwenden, kommt es auf Ihrer Website zu einer unendlichen Weiterleitungsschleife, die dazu führt, dass die Seiten nicht geladen werden.
Wenn Sie dies dennoch tun möchten, können Sie das All in One SEO (AIOSEO) Plugin verwenden.
Es ist das beste SEO-Plugin für WordPress und macht es super einfach, Ihre Website für Suchmaschinen zu optimieren. Außerdem bietet es Ihnen die Möglichkeit, das Basispräfix der Kategorie mit einem Klick auf eine Schaltfläche zu entfernen.
Für dieses Tutorial verwenden wir die AIOSEO Pro-Lizenz, weil sie die Funktion zum Entfernen der Kategoriebasis und andere leistungsstarke Optionen wie den Umleitungsmanager und den Link-Assistenten enthält. Es gibt auch eine kostenlose Version von AIOSEO, die Sie verwenden können.
Zunächst müssen Sie das AIOSEO-Plugin installieren und aktivieren. Weitere Einzelheiten finden Sie in unserer Anleitung zur Installation eines WordPress-Plugins.
Nach der Aktivierung sehen Sie den AIOSEO Einrichtungsassistenten. Klicken Sie einfach auf die Schaltfläche „Let’s Get Started“. Weitere Informationen finden Sie in unserer Anleitung zur Einrichtung von All in One SEO für WordPress.
Als Nächstes können Sie in Ihrem WordPress-Admin-Panel auf All in One SEO Search “ Appearance gehen und auf die Registerkarte „Taxonomien“ klicken.
Gehen Sie dann zum Abschnitt Kategorien und wechseln Sie zur Registerkarte „Erweitert“. Klicken Sie hier einfach auf „Ja“ für die Option „Basispräfix der Kategorie entfernen“.
Vergessen Sie nicht, auf die Schaltfläche „Änderungen speichern“ zu klicken, wenn Sie fertig sind.
Einrichten von Umleitungen nach einer Änderung des Basispräfixes der Kategorie
Wenn Sie das Basispräfix der Kategorie auf einer neuen WordPress-Website ändern oder entfernen, brauchen Sie nichts zu tun. Wenn Sie dies jedoch auf einer bestehenden Website tun, wird Benutzern, die die alte Kategorieseite besuchen, ein 404-Fehler angezeigt.
Um dies zu beheben, müssen Sie eine Umleitung einrichten, um sicherzustellen, dass sowohl Suchmaschinen als auch normale Besucher ordnungsgemäß auf die richtige Kategorieseite Ihrer Website umgeleitet werden.
Die einfachste Möglichkeit, eine Weiterleitung in WordPress einzurichten, ist die Verwendung des Plugins All in One SEO (AIOSEO).
Um zu beginnen, können Sie im WordPress-Administrationspanel zu All in One SEO “ Redirects gehen und dann auf die Schaltfläche „Activate Redirects“ klicken.
Sobald sie aktiv ist, können Sie auf die Registerkarte „Umleitungen“ gehen, um die Umleitung einzurichten.
Geben Sie einfach die URL, die Sie umleiten möchten, in das Feld „Quell-URL“ und den neuen Ort für den Link in das Feld „Ziel-URL“ ein.
Als Redirect-Typ können Sie „301 Moved Permanently“ aus dem Dropdown-Menü auswählen. Dadurch werden Ihre alten Kategorieseiten dauerhaft an das neue Ziel verschoben.
Vergessen Sie nicht, auf die Schaltfläche „Umleitung hinzufügen“ zu klicken, wenn Sie fertig sind.
Weitere Einzelheiten finden Sie in unserem Leitfaden für Anfänger zum Erstellen von 301-Weiterleitungen in WordPress.
Jetzt werden alle Ihre Benutzer und Suchmaschinen auf die korrekten URLs mit dem neuen Kategoriepräfix umgeleitet.
Wir hoffen, dass dieser Artikel Ihnen geholfen hat zu lernen, wie man das Basispräfix der Kategorie in WordPress ändert. Vielleicht interessiert Sie auch unsere Liste der meistgefragten WordPress-Tipps, -Tricks und -Hacks und wie man einen Online-Shop eröffnet.
Wenn Ihnen dieser Artikel gefallen hat, dann abonnieren Sie bitte unseren YouTube-Kanal für WordPress-Videotutorials. Sie können uns auch auf Twitter und Facebook finden.
Syed Balkhi says
Hey WPBeginner readers,
Did you know you can win exciting prizes by commenting on WPBeginner?
Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
You can get more details about the contest from here.
Start sharing your thoughts below to stand a chance to win!
Afaq Ahmad Khan says
When i set „Category base“ with „%category%“ in permalink it works fine but all other posts and page going in 404.
I have to set „Category base“ with „%category%“. How can it be achieve?
Aasif Ganaie says
I want to change „category“ base in „news“ as well as „tag“ into „topic“ on a WordPress website. Will this method work in Yoast redirects as I don’t want to use a separate plugin?
Meghan says
Instead of having URL.com/tag.. I want to change it to URL.com/category/tag but I can’t seem to do this. Can you easily explain how to achieve this?
Paul Minors says
Hi there. Great article. I’m looking at doing something similar, but I’m not changing the category or tag base. I’m changing the base of „portfolio“ pages. There isn’t an option to edit the case in the permalink settings. Is there another way to edit bases in my wordpress files?
Karunakar says
How to add a custom text to tag url slug?
For example:
my tag_base is „beginner“
my tag is: „wp“
Then normally url becomes: example.com/beginner/wp
Here I want to add text „help“ to the slug of tag „wp“ to make url as:
example.com/beginner/wp-help
I don’t want to go with a single tag slug edit. I want to append „-help“ to all existed tags slugs and upcoming tags.
How can i do it?
Please help.
Thank you.
spezially says
Hi ,
what’s the easiest way if I wanted to have my general post page + all the posts that refer to the general post category bring up a prefix (ex.: news.example.com . news.example.com/single-post )
?
so far the only solution I can think of is a 301 redirect in htaccess but I’m looking for something smoother….
Conal Stubbs says
I’ve found a somewhat odd way of removing the category part.
Just to explain, I’m creating a portfolio site with a category called ‚blog‘ for blogposts / latest news and one called ‚work‘ for completed design projects. Obviously the desired effect is to have the url as example.co.uk/blog (or work) rather than example.co.uk/category/blog, which looks just a bit naff I’m sure you’ll agree.
By simply putting a full stop in the category base entry field WordPress seems to ignore this requirement in the url and creates the leaner, cleaner version that was wanted.
Has anyone else seen this before? Do they know of any issues with it? I’m just getting to grips with WordPress having taught myself HTML, CSS and PHP, so I’ve only tried it on a local setup and with the twenty eleven theme.
WPBeginner Support says
This is an interesting approach. Did you consider using category archive templates, like category-blog.php and category-work.php? After using these templates you can use WordPress seo plugin to remove category slug from url and you will get your blog posts on example.com/blog and Work posts on example.com/work.
Admin
ashley says
perfect. thanks!
dinesh kumar says
it’s working but only one category not all category
i am use another category page will get a 404 (not found) error when trying to access the page again.
please update here
I want url overwriter
Santiago says
In this blog did you have problems? I can see that you remove the category base and looks pretty good. Could tell us how you do this?
WPBeginner Support says
If you are using WordPress SEO you can go to SEO » Permalinks check the box that says Strip the category base (usually /category/) from the category URL.
Admin
iAn says
I updated my WordPress SEO Plugin today and I got this message:
„The feature for stripping the category base will be removed in version 1.6 of WordPress SEO. We suggest using FV Top Level Categories if you insist on keeping this but do know that the feature is very error prone and not that important for your SEO.“
I guess you are using such feature too.
I worry that I will lose ranking if I „unstrip“ the category in the URL. Any suggestion for this?
Arup Ghosh says
Thanks to SEO plugins like yoast, they have added an option for this on their current version.
gnuboss says
Thanks for the info, this is a quick and simple, although often overlooked way to sort the category and tag base issues out..
To entirely remove the Category base I used to use a plugin called WP No Category Base which worked well, but can cause problems when you have a page and category with the same name – E.g. Page = Hosting (domain.com/hosting/) and a Category = Hosting (domain.com/hosting/) – but using .html suffix may help — but there are bound to be implications.
web design cheltenham says
I always like to use the .html suffix as well as changing the prefix – thanks for sharing – a simple but effective technique!
Name Removed [TOS Violation] says
If you want to do this, you should probably do this right when you begin your blog.
Otherwise, search engines which have indexed your
example.com/tags/some-tag
page will get a 404 (not found) error when trying to access the page again.
Some SEO plugins handle this case and give a 302 (redirect) status when you change a permalink, but I’m not sure about tag URLs.
Nimit Kashyap says
I didn’t know that it was so easy to change.