Editing WordPress on DigitalOcean gives you control to modify themes, CSS, plugins, or database settings. In this blog post we’ll show a few ways and best practices to edit WordPress code in your VPS.
1. Access the Server via SSH
- Open your terminal.
- Connect to the server:
ssh root@your-server-ip
2. Edit Theme Files
- Navigate to the theme directory:
cd /var/www/html/wp-content/themes/your-theme/
- Open and edit files using
nano
:
nano style.css
- Save changes by pressing Ctrl + O, then Enter. Exit with Ctrl + X.
3. Modify CSS Quickly via WordPress Admin
- Log into WordPress.
- Go to Appearance โ Customize โ Additional CSS.
- Add your CSS and click Publish.
4. Best Practices
- Backup regularly
- Clear cache if using caching plugins to reflect changes.
This method gives you control over your WordPress setup on DigitalOcean, allowing updates to themes, plugins, and settings.
Leave a Reply