Replace $mysite by the subdomain of the site you want to remove and $user by the associated username
- You may want to archive the website first
- Edit the DNS:
- Don't delete the DNS if the website has been archived

- Delete the records associated with the domain (don't forget www.)
- Don't delete the DNS if the website has been archived
- Database stuff:
- `# mysql
> DROP DATABASE $dbname;> REVOKE ALL PRIVILEGES, GRANT OPTION FROM '$user'@'localhost';> DROP USER '$user'@'localhost';
- Letsencrypt:
# vim /etc/dehydrated/domains.txt- → remove the occurences of
$mysite.squat.netandwww.$mysite.squat.net
- Apache config:
# vim /etc/apache2/sites-enabled/wordpress.conf→ Remove the line that matches$mysite.squat.net# vim /etc/apache2/sites-enabled/redirects.conf→ Remove the line(s) that match$mysite.squat.net# systemctl reload apache2
- Remove symlink and folders:
# rm -i /usr/share/wordpress/wp-content/uploads/$mysite# rm -rf /var/www/$mysite.squat.net# rm /etc/wordpress/config-$mysite.squat.net.php
- Delete the user associated with the website:
- First check if there are still files owned by the user:
find / -user $user 2>/dev/null- If there are results, fix it or talk about with other members
- Remove the user and its home directory:
# deluser --remove-home $user
- First check if there are still files owned by the user:
- Add a line in /root/Changelog