You could do this :
add_action('publish_post', 'wpse_107434_title_max_char');
function wpse_107434_title_max_char() {
global $post;
$title = $post->post_title;
if (strlen($title) >= 100 )
wp_die( "the title must be 100 characters at most" );
}
You can replace strlen()
with str_word_count()
if you want to set a word limit instead.
EDIT: ok with new details you added it seems you could add some jQuery to do the same (strlen)
Related Posts:
- How can you set maximum width for original images?
- Custom post type with a forced fixed aspect ratio image crop
- Cleanup uploads folder, Media Library db structure
- Rendering the uploaded file in a wp.media object
- How do I force WordPress to show most recent version of images in the media library?
- Linking a PDF as a downloadable document
- display image size in media library screen
- How to capture the selection:toggle event fired by wp.media
- wp media regenerate unknown –image_size parameter
- Best plugin to manage media library? [closed]
- Image dimensions same as image size
- Best image hosting service
- How to display all images “Uploaded By” an author
- Shortlink directly to a media file?
- Is it possible to generate JPEG progressive thumbnails?
- Change default tab of media manager
- How to set additional parameter in wp.media?
- Way to display media library in frontend
- get total number of images from media using xml-rpc
- Audio Playlist : How to bind events for “track change”, “track end”?
- Images are registered in media library but still won’t show up
- How do I control video media display sizing with native wordpress player
- Handle lots of images within the media uploader / selector
- Rest API rename media
- Disable drag and upload in Media Library
- Custom media picker in meta box: how to select available image sizes?
- FTP files directly to Media Library wp-content\uploads
- How to get an image url from media library
- Add media column to edit post screen
- Uploading Media gives error “Missing a temporary folder.”
- Add custom tab on the media manager
- Organizing media uploads
- How to insert an Audio Player in a Post or Page?
- Moving existing media items to new upload path structure not updating full URL path
- 3.5 Media Manager – callout in metaboxes
- Front end wp_editor not rendering audio/video links
- Force WordPress, themes & plugins into using defined sizes
- Media Manager: refresh library after new selection
- WordPress Media Image Manager — Creating Lots and Lots of Odd Sized Images
- Large image size stuck on old value, even for new images
- Can I force all uploaded images to be reduced in quality?
- Rotating image does not work for custom image sizes
- Audio Player for MP3 Files for WordPress
- How select multiple document as like media gallery
- Rebuild the entire WordPress uploads folder
- Get Image from Media Library with the Title
- See List View – or Image titles- of Media Library when “Add Media” button is used
- How to hide some specific attachments using post meta from media library
- How to extend an existing (Gutenberg) block
- It is possible to add custom media size in admin media edit?
- Importing Media IDs but not related attachment
- Link to resized media file
- Allow Editor Role to Edit Media
- Bulk image importing from folders
- WordPress media file link with fancybox
- How to open a Media Uploader dialog with a particular image is selected
- Editing image dimension – to edit the main image file
- media library not showing thumbnails after deleting full image
- Media attachment pages giving 404’s
- Extending wp.media.model, query media from different blog on network and refresh view
- Force image crop size in media editor
- Set Maximum Width for an uploaded image
- Use staging media files on development site in WordPress
- Getting a specific value out of array using get_attached_media
- WordPress 3.6 native player is not responsive?
- Thumbnail images chopped off but not cropped to exact dimensions
- Uploading a media item with the wp-json API to a specific path
- Theme loosing some images when moving to new server
- How to disable (and hide) the Media Library for certain users?
- formatting horizontal and vertical images in Settings?
- Get all media from wp-json/wp/v2/media
- Access generated thumbnails
- Publish / unpublish media items in the media library
- How to get all id_attachment with one loop?
- Media Library modal customization
- Get all uploaded images using REST api
- IPTC and custom thumb size
- WordPress REST API to get all media not working
- Disable Responsive Image Sizes crop
- Media isn’t showing in WordPress library but is available in uploads folder
- Append Media/Attachment IDs to Gallery Shortcode HTML Output
- Media Library not loading
- When inserting an image in a post, how to link the image to a resized URL instead of the full image URL?
- How do I get WordPress to create resizes of a supplied default image in a theme?
- MP4 file links download instead of playing
- Media and all images disappeared from my wordpress site
- Replace Swedish characters in filenames
- Get the Playlist embedded in Post/Page content
- Can we reuse WordPress drag drop media upload in plugins?
- How can I change the default image behavior?
- Import media in bulk with caption and titles?
- cant able to upload media to my wordpress blog
- Change image in media library at specific time
- wp media popup close all popup
- Import of 200+ sermons
- Unable to send upload url
- After import, oEmbeds non-functional until manual republish
- How to import and update images/galleries that point to an old site
- Media Library empty after server migration
- Add custom css class to wp-list-table row for Media Screen