Open the X app or website
Go to your profile icon or More menu
Select Settings and privacy
Tap Privacy and safety
Select Content you see
Turn off Display media that may contain sensitive content
Go back to Search settings
Turn off Hide sensitive content if available
Save changes if prompted
