What is the right way to clean up $title before wp_insert_post? August 21, 2022 by Tarik Billa Any WP built-in function? Yes, sanitize_title.