How to Secure Your Website
- Cyber Security
- Cloudflare setup, CSRF protection, cybersecurity checklist, free website security, html site protection, HTTPS, malware removal, secure configuration, secure hosting, shopify security, SQL injection fix, SSL, WAF, web hardening, website protection, website security, wordpress security, XSS prevention
- October 23, 2025
16. Lock down configuration & disable debugging
WordPress
-
In
wp-config.php -
Remove default files:
-
Add to
.htaccess: -
Use free plugin “WP Hardening by Astra” → one-click disable file editing, PHP execution in uploads, and directory browsing.
Shopify
-
Disable unused scripts/snippets:
In Online Store → Themes → Edit Code, delete unused JS/CSS. -
Remove any “console.log” or debugging outputs from theme code.
-
Apps handle debug logs internally — remove any dev/test apps after launch.
Static HTML
-
Turn off directory indexing:
-
In
config.php(if using PHP): -
Delete test pages (
info.php,test.html) and default server pages.
17. Protect sensitive data & encryption
WordPress
-
In
wp-config.php, use strong salts:
Refresh at https://api.wordpress.org/secret-key/1.1/salt/ -
Move
wp-config.phpone directory up from/public_html/. -
Use free plugin “Really Simple SSL (Free)” → auto-forces HTTPS on admin and cookies.
-
For database encryption (at-rest): host-level AES encryption or use free BitLocker (Windows) / LUKS (Linux) on server disk.
Shopify
-
All data stored by Shopify is encrypted at rest + in transit.
-
Avoid saving customer data in custom JS; rely on built-in metafields.
-
Disable “Storefront API” write permissions for public tokens.
Static HTML
-
Use Let’s Encrypt TLS (already set earlier).
-
If storing data (contact forms):
-
Never store secrets in JS or Git; use
.envfiles:and load server-side.
18. Enable security logging & monitoring
WordPress
-
Install “WP Activity Log (free)” → tracks login, plugin/theme edits, file changes.
-
Log to file:
-
Set file perms:
-
Review via Tools → Activity Log Viewer.
Shopify
-
View Settings → Plan → View your activity → shows admin events.
-
Use free Shopify Flow (if available on your plan) → log changes in Orders/Products/Customers.
-
Export logs weekly as CSV for archival.
Static HTML
-
Apache/Nginx logs:
-
Fail2ban (free):
→ auto-bans brute-force IPs.
-
Cloudflare → Security → Events: monitor blocked WAF requests (download CSVs weekly).
19. Secure credentials & remove secrets from code
WordPress
-
Move DB credentials to env vars (Apache example):
Add in.htaccess(above WordPress rules):Then in
wp-config.php: -
Delete any hard-coded API keys.
-
Use plugin “Secret Key Manager (free)” or
.env+vlucas/phpdotenv.
Shopify
-
Manage private app tokens via Settings → Apps → Develop Apps → rotate every 90 days.
-
Don’t store tokens inside theme JS or Liquid; use server-side proxy or environment variable.
Static HTML
-
If you have a
config.js, replace secrets with placeholders and load them server-side. -
Protect
.envfiles: -
Rotate SSH keys and API keys regularly.
20. Harden server-side configuration
WordPress
-
Disable dangerous PHP functions in
php.ini: -
Enforce firewall: use Cloudflare Free WAF or UFW (Linux):
-
Use Free SSL Labs scan (https://www.ssllabs.com/ssltest/) → aim for grade A.
Shopify
-
Shopify manages the stack; your job is to keep apps minimal and theme secure.
-
Review Content Security Policy meta and block third-party scripts.
-
Restrict admin IP (if on Shopify Plus) or via Cloudflare → Firewall → “Allow only your IP”.
Static HTML
-
Apache:
-
Nginx:
-
Confirm hardened permissions:
Leave Your Comment Here
You must be logged in to post a comment.
