Hi there 乃尺凵刀口,
Thank you for posting to Apple Support Communities.
We understand you'd like to delete attachments from Messages in iCloud. Is that right?
Messages cannot be set to sync text only. If you'd like to leave Apple feedback about this behavior, you can do so here: Product Feedback
However, you can manage the storage through Messages or contacts in your Contacts app. Apple has a great support document that explains this under the section, "Delete texts and attachments in Messages" Manage your iCloud storage - Apple Support
That should help. Let us know if you have any questions.
Take care.