WP Manifestindependent plugin directory
manifest / utilities / go-title-length-alert

Title Length Alert

alerts user in the post edit page when the post title length exceeds some configured character count

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/gigaom/go-title-length-alert/archive/refs/heads/master.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Gigaom Post Title Length Alert System

This plugin watches the length of the post title and warns the user via the title length message under the title text field when the text exceeds some predefined length. We have two thresholds: alert_threshold and high_alert_threshold, each of which can be configured to change the title length count to a different color to warn the writer.

Hacking notes

The alert and high alert threshold settings are obtained by calling the go_config filter, with our plugin slug go-title-length-alert. To set these configurations, just add a filter like this:

add_filter( 'go_config', function( $config, $which ) {
    if ( 'go-title-length-alert' == $which )
    {
        $config['alert_threshold'] = 55;
        $config['high_alert_threshold'] = 66;
    }

    return $config;
}, 11, 2 );

The "alert_threshold" configuration is the character length when the title span will be set to the go-title-length-alert-alert class, and the "high_alert_threshold" configuration is the character length when the title span will be set to the [go-title-length-alert-high-alert class] (https://github.com/GigaOM/go-title-length-alert/blob/79d2f7f675b802d00256c84269685a1d4e00fb3f/components/css/go-title-length-alert.css#L14).

These two classes are styled in the css to control what color to turn the title length count to when the length thresholds are exceeded.

Struggles & annoyances