How to Add CSS and JavaScript Code to a WordPress Site (The Easy Way)

  • Post last modified:Last updated on September 30, 2026
  • Post author:By
Activating Simple Custom CSS and JS Plugin in WordPress
Activating Simple Custom CSS and JS Plugin in WordPress

A new Custom CSS & JS item appears in your left sidebar.

Adding CSS in WordPress
Adding CSS in WordPress

Step 2: Add your code

Click Add Custom CSS (or Add Custom JS / Add Custom HTML). Give it a descriptive title — future you will thank present you — then write your code in the editor. Delete the sample code first and start fresh.

Click Add Custom CSS (or Add Custom JS / Add Custom HTML). Give it a descriptive title — future you will thank present you — then write your code in the editor. Delete the sample code first and start fresh.

On the right side you’ll see the key settings (free version):

  • Linking type — External File saves your code as a real file on your server; Internal embeds it dynamically via the WordPress API.
  • Linking type — External File saves your code as a real file on your server; Internal embeds it dynamically via the WordPress API.
  • Where on page — choose whether the code loads in the <head> or the <footer>. Scripts that don’t need to run immediately usually belong in the footer for better performance.
  • Where on page — choose whether the code loads in the <head> or the <footer>. Scripts that don’t need to run immediately usually belong in the footer for better performance.
  • Where on site — Frontend for your public site, Admin for the dashboard, or Login Page for customizing the login screen.
  • Where on site — Frontend for your public site, Admin for the dashboard, or Login Page for customizing the login screen.
CSS and JS Settings in WordPress
CSS and JS Settings in WordPress

Click Publish when you’re done.

Step 3: Clear your cache

If your site uses a caching plugin or your host has server-side caching, clear it now — otherwise visitors may keep seeing the old version of your site.

If your site uses a caching plugin or your host has server-side caching, clear it now — otherwise visitors may keep seeing the old version of your site.

A note on the alternatives

  • Customizer → Additional CSS works fine for small CSS tweaks, but it only handles CSS and offers no organization for larger changes.
  • Customizer → Additional CSS works fine for small CSS tweaks, but it only handles CSS and offers no organization for larger changes.
  • A child theme is the best home for code that’s part of your site’s design and should survive theme switches conceptually — see our child theme tutorial.
  • A child theme is the best home for code that’s part of your site’s design and should survive theme switches conceptually — see our child theme tutorial.
  • For code that does things (rather than just styling), consider packaging it as a small plugin — our plugin development basics guide walks through it.
  • For code that does things (rather than just styling), consider packaging it as a small plugin — our plugin development basics guide walks through it.

Whichever method you choose, keep custom code organized and documented. Six months from now, a snippet titled “test final v2” helps no one.

Whichever method you choose, keep custom code organized and documented. Six months from now, a snippet titled “test final v2” helps no one.

Custom CSS and JavaScript let you change how your WordPress site looks and behaves — tweaking colors and fonts, adding tracking scripts, or building small interactive features. WordPress offers several ways to add custom code: a plugin (easiest), the Customizer (CSS only), or a child theme with enqueued files (most robust).

This tutorial covers the easy way: the free Simple Custom CSS and JS plugin (400,000+ active installs). It adds a code editor right inside your dashboard, so you never have to touch theme files.

How to Add CSS and JS to a WordPress Site

Step 1: Install the plugin

  1. In your WordPress dashboard, go to Plugins → Add New.
  2. Search for “Simple Custom CSS and JS”.
  3. Click Install Now, then Activate.
Installing a Plugin in WordPress
Activating Simple Custom CSS and JS Plugin in WordPress

A new Custom CSS & JS item appears in your left sidebar.

Adding CSS in WordPress

Step 2: Add your code

Click Add Custom CSS (or Add Custom JS / Add Custom HTML). Give it a descriptive title — future you will thank present you — then write your code in the editor. Delete the sample code first and start fresh.

On the right side you’ll see the key settings (free version):

  • Linking type — External File saves your code as a real file on your server; Internal embeds it dynamically via the WordPress API.
  • Where on page — choose whether the code loads in the <head> or the <footer>. Scripts that don’t need to run immediately usually belong in the footer for better performance.
  • Where on site — Frontend for your public site, Admin for the dashboard, or Login Page for customizing the login screen.
CSS and JS Settings in WordPress

Click Publish when you’re done.

Step 3: Clear your cache

If your site uses a caching plugin or your host has server-side caching, clear it now — otherwise visitors may keep seeing the old version of your site.

A note on the alternatives

  • Customizer → Additional CSS works fine for small CSS tweaks, but it only handles CSS and offers no organization for larger changes.
  • A child theme is the best home for code that’s part of your site’s design and should survive theme switches conceptually — see our child theme tutorial.
  • For code that does things (rather than just styling), consider packaging it as a small plugin — our plugin development basics guide walks through it.

Whichever method you choose, keep custom code organized and documented. Six months from now, a snippet titled “test final v2” helps no one.

Custom CSS and JavaScript let you change how your WordPress site looks and behaves — tweaking colors and fonts, adding tracking scripts, or building small interactive features. WordPress offers several ways to add custom code: a plugin (easiest), the Customizer (CSS only), or a child theme with enqueued files (most robust).

Custom CSS and JavaScript let you change how your WordPress site looks and behaves — tweaking colors and fonts, adding tracking scripts, or building small interactive features. WordPress offers several ways to add custom code: a plugin (easiest), the Customizer (CSS only), or a child theme with enqueued files (most robust).

This tutorial covers the easy way: the free Simple Custom CSS and JS plugin (400,000+ active installs). It adds a code editor right inside your dashboard, so you never have to touch theme files.

This tutorial covers the easy way: the free Simple Custom CSS and JS plugin (400,000+ active installs). It adds a code editor right inside your dashboard, so you never have to touch theme files.

How to Add CSS and JS to a WordPress Site
How to Add CSS and JS to a WordPress Site

Step 1: Install the plugin

  1. In your WordPress dashboard, go to Plugins → Add New.
  2. Search for “Simple Custom CSS and JS”.
  3. Click Install Now, then Activate.
Installing a Plugin in WordPress
Installing a Plugin in WordPress
Activating Simple Custom CSS and JS Plugin in WordPress
Activating Simple Custom CSS and JS Plugin in WordPress

A new Custom CSS & JS item appears in your left sidebar.

Adding CSS in WordPress
Adding CSS in WordPress

Step 2: Add your code

Click Add Custom CSS (or Add Custom JS / Add Custom HTML). Give it a descriptive title — future you will thank present you — then write your code in the editor. Delete the sample code first and start fresh.

Click Add Custom CSS (or Add Custom JS / Add Custom HTML). Give it a descriptive title — future you will thank present you — then write your code in the editor. Delete the sample code first and start fresh.

On the right side you’ll see the key settings (free version):

  • Linking type — External File saves your code as a real file on your server; Internal embeds it dynamically via the WordPress API.
  • Linking type — External File saves your code as a real file on your server; Internal embeds it dynamically via the WordPress API.
  • Where on page — choose whether the code loads in the <head> or the <footer>. Scripts that don’t need to run immediately usually belong in the footer for better performance.
  • Where on page — choose whether the code loads in the <head> or the <footer>. Scripts that don’t need to run immediately usually belong in the footer for better performance.
  • Where on site — Frontend for your public site, Admin for the dashboard, or Login Page for customizing the login screen.
  • Where on site — Frontend for your public site, Admin for the dashboard, or Login Page for customizing the login screen.
CSS and JS Settings in WordPress
CSS and JS Settings in WordPress

Click Publish when you’re done.

Step 3: Clear your cache

If your site uses a caching plugin or your host has server-side caching, clear it now — otherwise visitors may keep seeing the old version of your site.

If your site uses a caching plugin or your host has server-side caching, clear it now — otherwise visitors may keep seeing the old version of your site.

A note on the alternatives

  • Customizer → Additional CSS works fine for small CSS tweaks, but it only handles CSS and offers no organization for larger changes.
  • Customizer → Additional CSS works fine for small CSS tweaks, but it only handles CSS and offers no organization for larger changes.
  • A child theme is the best home for code that’s part of your site’s design and should survive theme switches conceptually — see our child theme tutorial.
  • A child theme is the best home for code that’s part of your site’s design and should survive theme switches conceptually — see our child theme tutorial.
  • For code that does things (rather than just styling), consider packaging it as a small plugin — our plugin development basics guide walks through it.
  • For code that does things (rather than just styling), consider packaging it as a small plugin — our plugin development basics guide walks through it.

Whichever method you choose, keep custom code organized and documented. Six months from now, a snippet titled “test final v2” helps no one.

Whichever method you choose, keep custom code organized and documented. Six months from now, a snippet titled “test final v2” helps no one.

Editorial Team

The GetStartedWP editorial team is a team of WordPress experts and developers. We are passionate about creating and sharing content like tutorials and guides about the entire WordPress ecosystem.

Disclousure: Our content is reader-supported. This means if you click on some of our links, then we may earn a small commission.

Leave a Reply