remove query string from end of URL using .htaccess

it's simple, just use:

RewriteCond %{QUERY_STRING}    "post_type=" [NC]
RewriteRule (.*)  /$1? [R=301,L]

If you are going add this to wordpress website, you need add it before any wordpress rules:

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

but after

RewriteBase /

Just do something like this:

RewriteEngine On
RewriteBase /
# Make sure there is a query string
RewriteCond %{QUERY_STRING} .
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .*  /? [R=301,L]

Place a ? at the end to remove the query when present.