A long time ago you gave me the following code to add the category to my media files:
// ADD CATEGORY TO ATTACHEMNTS
function wptp_add_categories_to_attachments() {
register_taxonomy_for_object_type( ‘category’, ‘attachment’ );
}
add_action( ‘init’ , ‘wptp_add_categories_to_attachments’ );
This works all perfect - but I have the feeling that it now slows down my database
The problem is that I now have over 20,000 images in my blog and I have now assigned a category to every single picture.
Example:
I have a travel blog. So if the picture is in a report from Germany, it gets the category “Germany”. But the report itself also has the category “Germany”. So the category “Germany” is now mixed with posts and pictures.
This was never the case before. Under Posts > Categories > Germany only the posts were included, not the images. But now the images are counted there as well. This inflates the category Germany unnecessarily.
Is there a way to undo that? I can of course remove the code from the function.php. Then I would no longer specify categories for future images.
But how to delete the categories of the old images? They are not in a column in the database, are they? Is there a way? I hope you can help me.