Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
It to remove the ASCII code from the article that was posted in WordPress. And save.
function remove_ascii( $data ) {
$ascii = '/[\x08]/';
$data['post_content'] = preg_replace($ascii, '', $data['post_content']);
return $data;
add_filter( 'wp_insert_post_data' , 'remove_ascii' , 10, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.