To prevent website hacking that causes redirects or pop-ups, start by securing your server and website code. Keep all software, including CMS platforms, plugins, and themes, up to date to patch known vulnerabilities. Install a Web Application Firewall (WAF) like Cloudflare or Sucuri to block malicious traffic. Use strong passwords, enable two-factor authentication, and restrict file permissions. Regularly scan your website for malware using tools like Wordfence or Sucuri SiteCheck. If redirects only happen from Google Ads, check for conditional scripts targeting referrer headers. Monitor your .htaccess and core files for unauthorized changes. Back up your site regularly and use Google Search Console to catch security warnings early. Taking these steps helps keep your site clean and trustworthy.