Yes, absolutely remove such things.
Anything that is not relevant to the post is noise and should be removed.
That includes salutations, signatures, 'thanks' and the kind of content you have highlighted.
As noted in the Help Center, users are expected to avoid this type of fluff in their posts, and should expect it to be removed:
Do not use signature, taglines, greetings, thanks, or other chitchat.
Every post you make is already “signed” with your standard user card, which links directly back to your user page. Your user page belongs to you, so fill it with information about your interests, links to stuff you’ve worked on, or whatever else you like!
Thanks and other statements of appreciation are unnecessary, and, like other chitchat, should not be included.
If you use signatures, taglines, greetings, thanks, or other chitchat, they will be removed to reduce noise in the questions and answers.