How do I insert a wordpress post with '&' in the title

67 Views Asked by At

If I programmatically add a wordpress post with wp_insert_post and the title contains a & the & is converted to a &

For example: Tips & Tricks becomes Tips & Tricks

My only working solution is to do a $wpdb->update with the post title after the wp_insert_post. The parameters for the title are passed 1:1.

Is there a better way?

0

There are 0 best solutions below