Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wecodemore/wcm-termlimit

WordPress plugin to set a minimum needed tags/cats/etc. Or limit the amount of tags/cats or custom tax terms. On a per post type basis. Avoid authors using all your tags because of SEO. Or force a minimum because they don't care tagging posts. Just like seen on StackOverflow and other StackExchange sites: minimum 1 tag, maximum 5.
https://github.com/wecodemore/wcm-termlimit

Last synced: about 2 months ago
JSON representation

WordPress plugin to set a minimum needed tags/cats/etc. Or limit the amount of tags/cats or custom tax terms. On a per post type basis. Avoid authors using all your tags because of SEO. Or force a minimum because they don't care tagging posts. Just like seen on StackOverflow and other StackExchange sites: minimum 1 tag, maximum 5.

Awesome Lists containing this project

README

        

# WordPress Term Limits

> Limits terms (categories, post tags, custom taxonomy terms) on a per post type basis

Do you have lazy authors who don't care using a single tag?
Do you have wannabe SEO experts using all of your tags on each post?

Set an end to that. Just like seen on StackOverflow and other
StackExchange sites: minimum 1 tag, maximum 5.

(Yes you can define the amount yourself)

Needs **PHP 5.4+** to run. Will break with lower PHP versions.

### Is this a plugin?

**Yes**. For WordPress.

## How to install?

You can simply download it and are ready to go. Still the following options are preferred.

Or just install/import it into your project using Composer

composer create-project wcm/termlimits

Or clone the repository into your plugin directory using git

git clone [email protected]:wecodemore/wcm-termlimit.git

## How to use?

Per default, there is a minimum of `0` terms that need to get added.
The maximum is `3`. And the limit only applies for the `post` post type.

To alter the limit or the type, there are two filters that you can use in
a small child plugin:

```
append( explode( ",", filter_var(
$_POST['tax_input']['custom_terms'],
FILTER_SANITIZE_STRING,
[ FILTER_NULL_ON_FAILURE, ]
) ) );
}
}
```

To see what exactly you should take as input/`$_POST` value, use
the following mini-plugin to dump your `save_post` action.

```