How to Add Custom CSS to WordPress Themes
Use browser developer tools to identify correct CSS selectors for specific styling rather than relying on the !important override rule.
Based on 8 community reports.
Linked sources: 9.
Known Issues
- Overusing !important can lead to maintenance difficulties
- Theme updates may overwrite changes made directly in style.css
Community Q&A
How do I add custom CSS to my WordPress site?
You can add custom CSS via the WordPress Customizer under ‘Additional CSS’ or by using a child theme’s style.css file.
Should I use !important in my custom CSS?
It is generally recommended to avoid !important and instead use more specific CSS selectors to override existing styles.
How can I find the right CSS selector to change?
Right-click the element on your website and select ‘Inspect’ in your browser to view the current CSS classes and styles applied.
Reddit Sources
- Raw Gutenberg Challenge (r/Wordpress)
- 5 Things You Never Skip Before Stepping into WordPress Development (A Personal Experience) (r/Wordpress)
- Advice on how to take on updating a client’s existing custom theme from a few years ago (r/Wordpress)
- Why is Gutenberg + TT5 so limited? (r/Wordpress)
- How do I override the theme with my own css? (r/Wordpress)
- GoDaddy Managed WordPress - Can’t upload custom static HTML site (permission denied on root files, SFTP only shows when WP is installed) (r/Wordpress)
- I’ve been trying to make WooCommerce development feel more like building a Shopify theme with liquid (r/Wordpress)
- Moved off WordPress to Astro after a $2k Core Web Vitals quote. Will I regret it? (r/Wordpress)
- [DISCUSSION] I built a free WordPress plugin for Amazon affiliates - product boxes, comparison tables, geo-targeting across 22 marketplaces (r/Wordpress)