Is it possible to run wp_kses on all posts?

For security purposes, we're mostly using the wordpress json api to display our posts/categories and we went to remove any malicious tags. I'm a bit unfamiliar with WP development... but what I'm trying to achieve is basically:

  1. Query all current posts
  2. Run wp_kses on all the post's content?

What I'm trying so far in functions.php

  $post_args = array(
    'posts_per_page' = -1
  );
  $post_query = new WP_Query($post_args);

  while( $post_query-have_posts()): $post_query-the_post();
    // wp_kses the content here???
  endwhile; 

I'm not entirely sure where go from here.

Topic wp-kses posts Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.