No Category Parents

Àpèjúwe

This plugin completely removes the mandatory ‘Category Base’ and all the parents from your
category permalinks (e.g. /category/parent-category/my-category/ becomes /my-category/).

It also shortens post permalinks when you use the /%category%/ permastruct, so a post filed
under a deeply nested category still gets a short URL.

If a post or page already uses the same slug as a category, the post keeps the clean URL and
the category is served from /my-category-cat/ instead.

Ìgbéwọlẹ̀

  1. Install and activate the plugin through the ‘Plugins’ menu in WordPress.
  2. ThatÌtumọ̀ Yorùbá: ’s it. Your categories are now reachable at http://mysite.com/my-category/

Deactivating the plugin restores the stock WordPress permalinks.

FAQ

My category URLs did not change

Go to Settings > Permalinks and press Save once. That rebuilds the rewrite rules.

Do old links with the parent path still work?

Yes. /parent-category/my-category/ keeps resolving to the same archive.

Àwọn àgbéyẹ̀wò

Ọ̀wẹ́wẹ̀ 3, 2016
everything you need
Ka gbogbo àwọn àgbéyẹ̀wò 3

Àwọn Olùkópa & Olùgbéejáde

“No Category Parents” jẹ́ ètò ìṣàmúlò orísun ṣíṣí sílẹ̀. Àwọn ènìyàn wọ̀nyí ti ṣe ìkópa sí plugin yìí.

Àwọn Olùkópa

Túmọ̀ “No Category Parents” sí èdè rẹ.

Ṣe o nífẹ̀ẹ́ sí ìdàgbàsókè?

Ṣàwárí koodu, ṣàyẹ̀wò ibi ìpamọ́ SVN, tàbí ṣe àgbékalẹ̀ sí àkọsílẹ̀ ìdàgbàsókè nípasẹ̀ RSS.

Àkọsílẹ̀ àwọn àyípadà

0.3.1

  • Update the plugin URI to point at the plugin landing page.

0.3.0

  • Compatible with WordPress 7.0 and PHP 8.
  • Fixed: parent categories were only removed one level deep. A category nested two or more
    levels down (parent > child > grandchild) kept its immediate parent in the URL. Links are
    now rebuilt from the term instead of being regex-patched, so any depth works.
  • Fixed: PHP 8 warnings (“Undefined array key 0”, “Attempt to read property ID on null”)
    when building permalinks.
  • Fixed: the rewrite rules were flushed on every page load, rebuilding and re-saving the
    whole rule set on each request. Flushing now happens once, only after a category changes.
    Measured on a local WordPress 7.0 install: ~197 ms/request before, ~114 ms/request after.
  • Added: category feeds (/my-category/feed/) now resolve.
  • Changed: all functions are prefixed with ncp_. Earlier versions declared generic names
    such as filter_category() and my_flush_rules() in the global namespace, which could
    collide with a theme or another plugin.
  • Changed: the category base is now forced empty through a filter instead of being written
    to the database on every request.
  • Added: ncp_collision_suffix and ncp_post_link_category filters.
  • Removed: leftover debug code and an unused id query var.

0.2.4.1

  • Quickfix: fixed pagination bug

0.2.4

  • Tested up to WP 4.1
  • Fixed pagination problem (special thanks to Lukáš Wojnar).

0.2.3

  • Changed some links.
  • Fixed “empty category” problem (special thanks to absolutex).

0.2.2

  • In 0.2.1 when the “Category Base” field wasnÌtumọ̀ Yorùbá: ’t empty the plugin didnÌtumọ̀ Yorùbá: ’t work. Now the
    “Category Base” field will automatically be empty when you activate the plugin.

0.2.1

  • Minor changes in the comments.

0.2

  • The plugin now works with the permastruct /%category%/ and also replaces the post permalinks.
  • Other minor fixes.