用于删除插入到Wordpress中的帖子的图像上的所有类的功能

When posting in Wordpress, I would like to have no classes assigned to my images by default. Every time I add images into my post, I get image classes I dont need, thus having to remove them every time.

Here is an example:

<img class="alignnone size-full wp-image-5129"

I would like to change to:

<img class=""

I don't want to change this in the media.php, so I've read about adding a filter through the functions.php

Can someone explain how to do this for a beginner? I have no clue about php

I am using the latest Wordpress version.

I think this one liner should do it:

add_filter( 'get_image_tag_class', '__return_empty_string' );

You can read more about this filter in the Codex. You could also use jQuery to achieve your goal. Another one liner

$('img').removeClass();

although I'd go with the filter one.