When I want to protect a post on one of my blogs, I like to use a passphrase instead of a password (albeit purely for the sake of creativity, not security â they’re stored plainly anyway). However, these passphrases often get very long, and when I enter a passphrase that’s too long, it gets silently truncated to 20 characters, much to my disdain.
Looking in the wp_posts
table, I see that the post_password
column is a VARCHAR(20)
. That explains the arbitrary truncation, but at the same time it raises a concern: if I want to increase the character limit so I can use longer post passwords, it would have to involve altering wp_posts.post_password
, besides possibly overriding any validation or processing routines (which is trivial by using filter hooks).
Altering the column directly using SQL doesn’t seem like a smart idea. Is there a safe way to increase the maximum character limit for post passwords, that won’t cause problems with my database when it comes to things like upgrades? (Better still if I can turn this functionality into a plugin, as I don’t see such a plugin available yet…)
If its not for security, it seems odd to spend time on it. Rather ensure the password isn’t truncated using a simple javascript character limit on the field and then work within the basic functionality – as you’ve stated, they are saved as plain text anyway. Maybe you’re looking for an alternative way to protect your posts?