WordPress FAQ

How to Add Custom CSS to WordPress Safely

The community recommends using the WordPress Customizer or a child theme while ensuring CSS specificity to avoid relying on !important declarations. medium confidence based on 8 community reports

The community recommends using the WordPress Customizer or a child theme while ensuring CSS specificity to avoid relying on !important declarations.

Based on 8 community reports.

Linked sources: 9.

Known Issues

Community Q&A

Where is the best place to add custom CSS in WordPress?

The recommended method is using the ‘Additional CSS’ section in the WordPress Customizer, which allows you to see changes in real-time.

Should I use !important in my custom CSS?

No, you should avoid using !important. Instead, use browser developer tools to identify the correct CSS selectors to increase specificity.

Will my custom CSS be lost when I update my theme?

If you add CSS via the WordPress Customizer, it will persist. If you edit theme files directly, your changes will be lost unless you use a child theme.

Reddit Sources