---
title: Hide the primary category dropdown on the post edit screen
url: "https://www.seopress.org/support/hooks/hide-the-primary-category-dropdown-on-the-post-edit-screen/"
lang: en-US
updated: 2026-10-23
hook_name: seopress_primary_term_inline_selector
required_version: 10.4
---

# Hide the primary category dropdown on the post edit screen

- **Hook name:** `seopress_primary_term_inline_selector`
- **Required version:** 10.4

```php
<?php
// Hide the dropdown everywhere.
add_filter( 'seopress_primary_term_inline_selector', '__return_false' );

// Hide it in the Categories box only.
add_filter( 'seopress_primary_term_inline_selector', 'sp_hide_primary_category_dropdown', 10, 3 );
function sp_hide_primary_category_dropdown( $enabled, $taxonomy, $post_type ) {
	if ( 'category' === $taxonomy ) {
		return false;
	}
	return $enabled;
}

// Hide it on WooCommerce products only.
add_filter( 'seopress_primary_term_inline_selector', 'sp_hide_primary_product_cat_dropdown', 10, 3 );
function sp_hide_primary_product_cat_dropdown( $enabled, $taxonomy, $post_type ) {
	if ( 'product' === $post_type ) {
		return false;
	}
	return $enabled;
}
```

Source: [https://gist.github.com/wp-seopress/93f2fe489300d8f3ce043e41a873ff09](https://gist.github.com/wp-seopress/93f2fe489300d8f3ce043e41a873ff09)


- This filter only hides the dropdown. A primary category that is already saved still drives your `%category%` permalinks and breadcrumbs.
- Posts without a primary category keep using the default WordPress category.
- The primary category field is still available in the **Advanced** tab of the SEO metabox.
- To turn off the primary category feature completely for a taxonomy, use the `seopress_primary_term_taxonomies` filter instead.
