Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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...)

share|improve this question

1 Answer 1

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?

share|improve this answer
    
Perhaps I am. I'm almost tempted to protect my entire blog with a single password instead, in good ol' HTTP 401 fashion. But what would you suggest? –  BoltClock Jul 1 '12 at 0:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.