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.

Is there a way to prevent WordPress from including special characters like – (long dash), ", ', etc.. from the post slugs?

Basically, I'd like to run the post-slug through a filter when it is created, and strip any special chars.

The reason is, that it's giving me problems as these show up as utf8-urlencoded in my rss feed, and those links don't work.

share|improve this question
    
allowed tags, etc. can be found in formatting.php –  kaiser Dec 20 '11 at 23:38
add comment

1 Answer

up vote 1 down vote accepted

Found the answer I was looking for:

<?php

    // Cleans special characters out of the slug, if the slug hasn't been set yet
    add_filter('name_save_pre', 'clean_slugs', 0);

?>
share|improve this answer
    
Just a reminder, when you are back, don't forget to mark this as your answer. :) –  its_me Jul 17 '12 at 3:54
add comment

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.