Block OP_RETURN Transactions
To prevent your Bitcoin Core or Knots node from relaying or mining OP_RETURN transactions, add this to your bitcoin.conf:
# Rejects all transactions containing OP_RETURN outputs
datacarrier=0
This works in all versions and is not deprecated. Your node’s mempool will stay free of OP_RETURN data.