You could add this function :
add_action('publish_post', 'wpse_105297_max_char');
function wpse_105297_max_char() {
global $post;
$title = $post->post_title;
if (strlen($title) >= 100 )
wp_die( "The max lenght is 100 for title" );
}
This will prevent users from using too much longer titles.
Related Posts:
- Solution to render Shortcodes in Admin Editor
- VERY new to coding – keep breaking site trying to add to functions.php
- wpautop – disable tags, keep tags
- Tiny MCE-modifications (plugins) stopped working in WordPress 5.6
- Publish/Update post is changing image links from file url to post url
- Insert image in WordPress with HTML5 tag and caption function
- WordPress functions.php – Execute plugin specific user online
- How to set default post editor based on role?
- Where do I go to edit this area? [closed]
- WordPress wraps span tags into p tags
- Adding tables to the WordPress Editor
- Editor cannot access Theme Options
- Add functionality to post editor
- Remove heading tags on line break
- When the WP_EDITOR button is pressed, the user is prompted to select a photo from their device
- How to check if a user exists by a given id
- Redeclare a function in a child theme
- TinyMCE custom styles remove class when switching styles
- How can I programmatically create “child” pages on theme activation?
- Add admin bar link to edit author
- Extending the site search to include a single custom field
- How to include one class/instance without using global variables
- Modify search function in WordPress (TwentyTwelve)
- Show/hide Widgets in Dashboard Based on Current Advanced Custom Fields Option
- syntax for remove_filter in parent theme with class
- Remove Header and Footer in iframe
- How to Acheive the custom woocommerce category template
- Can I remove the Rich Text box editor for a specific post?
- How to add CSS style sheet dynamically in wordpress
- How to update BuddyPress xprofile fields programmatically? [closed]
- Redirect if not logged in?
- Replace Archive Widget Link Text
- A snippet after every image
- Programmatically set page template based on page ID
- How can I add an image field to BuddyPress Extended Profile Fields? [closed]
- wp_remote_post with ssl:// protocol
- Best way to programatically add “rel” attributes to page and post images
- Remove function or filter
- options.php problem – data not saved
- How to include local menu based on page id?
- CSS for menu item added via functions.php
- How to add custom fields to my custom registration form
- Default Gallery Edit/Template Editable?
- How can I change the do_action function in footer (copyright area)
- How to display post content instead of excerpt
- Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘greenday_head’ not found or invalid function name
- Override a theme function in a child theme?
- changing behaviour of get_search_form
- Include default functions and methods
- Functions in custom theme
- Please Explain the Importing Process of Multiple Stylesheets for Child Themes
- Functions.php – Cannot Modify Header Information SOLVED [closed]
- check if author has published posts in custom post type, then send mail
- paginate_links() don’t properly work in search.php?
- shortcode help require
- AMP – Change rel=”canonical” from functions.php [closed]
- echo custom fields with AJAX
- Function filter breaking tag archive menus
- How to create a functions.php in child theme? [closed]
- wordpress get_post_meta give only first value
- How to echo the value of an array element using a function via a shortcode
- Determine if, within a post, you are on page 2 or greater – WordPress documentation circular
- Convert multiple logos into the_custom_logo
- I can’t add CSS with functions.php
- Register_Sidebar overwriting itself and doesn’t exist in global $wp_registered_sidebars;
- Protect get_query_var from manual input in url
- widgets not working
- Shortcode to get featured image of specific id post
- wp_get_archives() output
- hook for dashboard show_user_profile
- Problem with WordPress output text (‘esc_html’ & ‘wp_richedit_pre’)
- Get slug of current category in functions.php
- Prevent wp_signon redirect on failed login for ajax login
- removing description tabs – single product page – breaks footer
- is_email gives me error
- only update titles of single posts
- Post content overflows on my mobile phone
- OOP Switch statement with array as parameter
- Woocommerce custom calculation function
- button to toggle css styling / div visibility?
- How can I stop the hook from breaking the login/logout function?
- Pagination won’t work on custom page
- Does WordPress function replace_hello() exists?
- Shortcode Function – Can’t get anything else to return after running shortcode within shortcode
- Using wp_localize_script in template file – is it secure?
- Trying to Add a LEFT Sidebar?
- Login functions
- Getting error while trying to use custom comment function
- Load WP Admin scripts in a child theme functions file
- add_role menu pages are not visible
- Highlight only current on single pages
- Site is not updating because something is wrong with custom code. How to fix it?
- Changes doesn’t show up on blog
- Adding pagination to custom WordPress function
- Echo a div to header.php from functions.php
- Making an under maintenance page (without using plugins)
- Image width issue in IE [closed]
- Changed functions.php file and now site is blank [closed]
- PHP error in shortcode [closed]
- Problem with removing characters “<” – WpAllImport