Think adding an animated background to your WordPress site is complicated? Think again.
We used to share that belief, but after some experimentation, we’ve discovered that it’s actually quite simple.
Captivating your visitors from the moment they arrive on your site is crucial. An animated background is an excellent design element in WordPress that creates a memorable first impression without distracting from your content.
If you’re concerned about slow loading times, complicated coding, or costly plugins, there’s no need to worry. We’ve found an easy solution using particle.js, a lightweight JavaScript library that produces stunning animated backgrounds without affecting your site’s performance.
In this guide, we will walk you through the process of adding beautiful particle animations to your WordPress site, whether you choose to use a plugin or some code. Let’s help your website shine!
Why Should You Add an Animated Background to Your WordPress Site?
At first glance, customizing your website’s background may seem trivial. However, after years of experience in the WordPress and web design industry, we’ve observed that websites with carefully crafted animated backgrounds tend to engage visitors for a longer duration.
Incorporating an animated background can significantly improve your website’s visual appeal, making it more engaging and attractive to visitors. This feature conveys a sense of high-quality and modern design for your WordPress site.
Many websites utilize animated effects to commemorate special events and occasions.
For instance, eCommerce sites often add animated snowflakes or falling Christmas trees to their pages, creating a festive ambiance during the holiday season.
Some websites also implement a preloader background animation.
This approach gives visitors the impression that the site is loading, increasing the likelihood that they will wait patiently for the web page elements to load. For more details, you can check our article on adding a preloader background animation.
In this guide, we will demonstrate how to add an animated background using particle.js. If you’re curious about what particle.js is, just move on to the next section.
What Is particle.js?
Particle.js is a JavaScript library that enables you to create captivating visual effects using particles, which are small, animated graphical elements.
You can customize these particles in terms of size, color, shape, and movement. They also interact with users, responding to mouse movements or clicks, which enhances engagement on your website.
Now that you understand what particle.js is, let’s explore how to implement it for an animated background in WordPress. This guide offers two beginner-friendly methods, and you can navigate using the quick links provided below:
- Method 1: Adding an Animated Background Using a Page Builder (No Coding Required)
- Method 2: Adding an Animated Background Using Code (Free Option)
✨ Looking for assistance with your WordPress website design?Don’t let your website’s potential go untapped. Our team at CanadaCreate Pro Services can revamp your site, enhance its performance, and create high-converting content, allowing you to concentrate on growing your business.
Schedule a Free Consultation Call with Our Team Today!
Method 1: Adding an Animated Background Using a Page Builder (No Coding Required)
The first method involves using SeedProd, the leading WordPress page builder plugin available. It features a built-in, highly customizable particle background option.
You can select from a variety of pre-existing particle animations or create your own custom animation. Additionally, you can adjust the number of particles, their movement patterns, and hover effects to match your style.
For detailed insights on SeedProd, be sure to read our comprehensive SeedProd review. We discuss all aspects, including customization features, template and block selections, and integration with third-party tools.
This guide focuses on the premium version of SeedProd, as it includes the particle background feature.
To get started with SeedProd, you need to install and activate the plugin first. For step-by-step instructions, refer to our beginner’s guide on installing a WordPress plugin.
Next, simply copy and paste your license key into the plugin. Go to your WordPress dashboard and navigate to SeedProd » Settings,then enter the license key in the designated field and click ‘Verify Key.’
If you wish to customize your theme before adding a particle background in WordPress, check out our guide on how to easily create a custom theme using SeedProd.
Begin by launching the drag-and-drop builder for the specific page where you want to add the animated particle background. If you’ve created a theme using SeedProd, you should already have some pages set up in WordPress.
Next, navigate to Pages » All Pages and hover your mouse over the page you wish to edit, such as your homepage, about page, or any other page. Then, click on the ‘Edit with SeedProd’ button.
If you don’t see this option, there’s no need to worry.
Simply click the ‘Edit’ button instead, and within the block editor, select the ‘Edit with SeedProd’ option.
You will now be in the SeedProd page builder.
Hover over the section of the page where you want to insert the particle background in WordPress and select it. You’ll know you’ve selected a section when a purple border and toolbar appear at the top.
After selecting a section, the Section sidebar should appear on the left side.
Now, just switch to the ‘Advanced’ tab and toggle the ‘Enable Particle Background’ option.
You can customize several settings for the Particle Background.
One of the options is Style, where you can choose from various animation effects, including Polygon, Space, Snow, Snowflakes, Christmas, Halloween, and Custom.
In this article, we will explore how to add a unique particle background animation to your site.
The Opacity setting allows you to adjust how transparent the animation appears, while the Flow Direction determines the path that the particles will follow.
You can also personalize the colors of certain particle styles.
However, for festive themes like Christmas and Halloween, color customization is not available since the particles are represented as images.
Beneath the Color settings, you’ll find ‘Advanced Settings.’ Activating this option allows you to adjust the Number of Particles, Particle Size, Move Speed, and Enable Hover Effect.
With the Hover Effect enabled, the particles will respond to your mouse movements. Keep in mind that this feature will not function when viewing your WordPress site in the page builder mode or if the section is fully occupied by content.
That’s all there is to it.
After customizing your WordPress particle background, click the ‘Save’ button in the top right corner to apply your changes. You can also click the ‘Preview’ button to check how the particle background appears.
How to Create a Custom Particle Background for Your Website
If the available animated effects don’t meet your requirements, you can create a custom option. Simply select the ‘Custom’ style in the Particle Background settings.
Next, click the link that says ‘Please visit the link here and choose required attributes for particle.’
This link will direct you to Vincent Garreau’s website, which offers a JavaScript library for particle animations.
On this site, you can personalize your desired particle design, its interactivity, and the background color.
In the ‘particles’ settings, you can modify the number of particles, their color, shape, size, opacity, the lines connecting them, and their movement.
Below that, you’ll find the ‘interactivity’ section.
Here, you can customize how the particles respond when you hover over or click on them.
Lastly, there’s the ‘page background (css)’ option. In this section, you can change the background color of the particle animation and adjust its size, position, and repetition.
If needed, you can also upload a custom background image URL.
Once you’re finished, click the ‘Download current config (json)’ button at the bottom.
This will download the JSON code file for the particle background, which you need to open with a text editor application. Keep the text editor open as you proceed to the next steps.
Now, let’s return to the SeedProd page builder.
Go back to the Particle Background section within the Advanced settings. Then, copy the JSON code and paste it into the designated text box.
You should now see your particle background displayed in the preview section.
Click ‘Preview’ to view how the particle background appears on the front end, and click ‘Save’ to apply the changes.
Here’s an example of how the particle background might look:
Method 2: Adding an Animated Background Using Code (Free)
If using a page builder to add an animated background feels overwhelming, you can also do it with code. Don’t worry if you’re not a coding expert; we’ll use WPCode to make this process safe and easy.
You can use either the free or premium version of WPCode for this tutorial. The free version works perfectly well, but the premium version offers additional features like AI code generation and a testing mode.
If you need more information, you can check out our WPCode review.
First, install the plugin on your WordPress admin dashboard.
After activating the plugin, navigate to Code Snippets » + Add Snippetin your dashboard, then click on ‘Add Your Custom Code (New Snippet)’ followed by the ‘+ Add Custom Snippet’ button.
Next, select the type of snippet you want to create.
Since we will be using a mix of HTML, JavaScript, and CSS, choose ‘HTML Snippet’ from the available options.
Now, assign a memorable name to your snippet.
A simple name like ‘Particle.js Background’ works well.
Now, paste the following code into the snippet area.
This code is adapted from the Vincent Garreau website mentioned in the first method, but we will guide you on how to customize it further using just code:
<!-- HTML --><!– Include the particles.js library –><script src=”https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js”></script>
<!– Include your custom styles –><style>
/* Reset styles */
body {
margin: 0;
font: normal 75% Arial, Helvetica, sans-serif;
}
canvas {display: block;
vertical-align: bottom;
}
/* Particles.js container */#particles-js {
position: fixed;
top: 0;
width: 100%;
height: 100%;
/* Background color; change this to any valid CSS color value */
background-color: #b61924; /* <– Customize background color here */
/* Optional background image; add the URL inside the quotes */
background-image: url(“”); /* <– Add background image URL here */
background-repeat: no-repeat;
background-size: cover;
background-position: 50% 50%;
z-index: -1; /* Ensure the particles are behind other content */
}
/* Optional stats styles */.count-particles {
background: #000022;
position: absolute;
top: 48px;
left: 0;
width: 80px;
color: #13E8E9;
font-size: 0.8em;
text-align: left;
text-indent: 4px;
line-height: 14px;
padding-bottom: 2px;
font-family: Helvetica, Arial, sans-serif;
font-weight: bold;
border-radius: 0 0 3px 3px;
-webkit-user-select: none;
margin-top: 5px;
margin-left: 5px;
}
.js-count-particles {
font-size: 1.1em;
}
</style>
<!– Particles.js container –>
<div id=”particles-js”></div>
<!– Optional Stats Display –>
<div class=”count-particles”>
<span class=”js-count-particles”>–</span> particles
</div>
<!– Initialize particles.js –>
<script>
/* Customize the particles.js parameters below */
particlesJS(“particles-js”, {
“particles”: {
“number”: {
“value”: 80, /* <– Number of particles; adjust this value */
“density”: {
“enable”: true,
“value_area”: 800 /* <– Particle density area */
}
},
“color”: {
“value”: “#ffffff” /* <– Particle color; change to any valid CSS color */
},
“shape”: {
“type”: “circle”, /* <– Particle shape: “circle”, “edge”, “triangle”, etc. */
“stroke”: {
“width”: 0,
“color”: “#000000” /* <– Stroke color of particles */
},
“polygon”: {
“nb_sides”: 5 /* <– Number of sides for polygon shape */
},
“image”: {
“src”: “img/github.svg”, /* <– URL of custom image for particles */
“width”: 100,
“height”: 100
}
},
“opacity”: {
“value”: 0.5, /* <– Opacity of particles */
“random”: false, /* <– Whether opacity is random */
“anim”: {
“enable”: false,
“speed”: 1,
“opacity_min”: 0.1,
“sync”: false
}
},
“size”: {
“value”: 3, /* <– Size of particles; adjust to change particle size */
“random”: true, /* <– Whether particle size is random */
“anim”: {
“enable”: false,
“speed”: 40,
“size_min”: 0.1,
“sync”: false
}
},
“line_linked”: {
“enable”: true, /* <– Enable lines between particles */
“distance”: 150, /* <– Maximum distance for linking particles */
“color”: “#ffffff”, /* <– Color of the lines */
“opacity”: 0.4, /* <– Opacity of the lines */
“width”: 1 /* <– Width of the lines */
},
“move”: {
“enable”: true, /* <– Enable particle movement */
“speed”: 6, /* <– Speed of particle movement */
“direction”: “none”, /* <– Direction of movement */
“random”: false, /* <– Randomize movement direction */
“straight”: false, /* <– Move in straight lines */
“out_mode”: “out”, /* <– Action when particles go out of canvas */
“bounce”: false, /* <– Enable particles to bounce off edges */
“attract”: {
“enable”: false, /* <– Attract particles toward mouse */
“rotateX”: 600,
“rotateY”: 1200
}
}
},
“interactivity”: {
“detect_on”: “canvas”, /* <– Interaction events occur on “canvas” or “window” */
“events”: {
“onhover”: {
“enable”: true, /* <– Enable interaction on hover */
“mode”: “repulse” /* <– Interaction mode on hover: “grab”, “bubble”, “repulse” */
},
“onclick”: {
“enable”: true, /* <– Enable interaction on click */
“mode”: “push” /* <– Interaction mode on click: “push”, “remove”, “bubble”, “repulse” */
},
“resize”: true /* <– Enable reactivity to window resize */
},
“modes”: {
“grab”: {
“distance”: 400, /* <– Distance for grab mode */
“line_linked”: {
“opacity”: 1
}
},
“bubble”: {
“distance”: 400, /* <– Distance for bubble mode */
“size”: 40, /* <– Size of particles in bubble mode */
“duration”: 2, /* <– Duration of bubble effect */
“opacity”: 8, /* <– Opacity of particles in bubble mode */
“speed”: 3 /* <– Speed of bubble effect */
},
“repulse”: {
“distance”: 200, /* <– Distance for repulse mode */
“duration”: 0.4 /* <– Duration of repulse effect */
},
“push”: {
“particles_nb”: 4 /* <– Number of particles added on click */
},
“remove”: {
“particles_nb”: 2 /* <– Number of particles removed on click */
}
}
},
“retina_detect”: true /* <– Enable retina display support */
});
/* Optional: Variables for stats.js (if used) */
var count_particles, stats, update;
</script>
This code is quite lengthy, so let’s break down the customizable sections.
To modify the background color, update the background-color property found within #particles-js. Replace #b61924 with any valid CSS color value, such as #FF0000 for red or rgb(255,0,0) or even use color names like red.
background-color: #b61924; /* <-- Customize background color here */
To add a background image, set the background-image property by including the URL of your image within the url("").
Ensure the path or URL of the background image is accurate.
background-image: url("path/to/your/image.jpg"); /* <-- Add background image URL here */
To adjust the number of particles, modify the "value"undernumber.
Increasing this value will add more particles, while decreasing it will reduce their number.
"number": { "value": 80, /* <-- Adjust this value to set the number of particles */ // ...
}
To adjust thesize of the particles, modify thevalueundersize.
A higher number will increase the particle size, and a lower number will decrease it.
"size": { "value": 3, /* <-- Adjust this value to change the size of the particles */ "random": true, /* <-- Set to false for a uniform particle size */ // ...
}
To modify thecolor of the particles, replace thevalueincolorwith any valid CSS color value.
"color": { "value": "#ffffff" /* <-- Change this to any valid CSS color for particle color */
},
To change theshape of the particles, you can customize the "type" under "shape".
You can select shapes such as "circle", "edge", "triangle", "polygon", or even "star".
"shape": { "type": "circle", /* <-- Particle shape options: "circle", "edge", "triangle", etc. */ // ...
},
To modify the properties of the lines connecting particles, you can adjust the settings under "line_linked".
For example, if you change "enable": true to "enable": false, then the lines connecting the particles will not be visible.
"line_linked": { "enable": true, /* <-- Enable lines connecting particles */ // ...
},
You can also customize the line color, opacity, and thickness.
{ "line_linked": { "color": "#ffffff", "opacity": 0.4, "width": 1 }
}Feel free to make adjustments later, as you can modify the code even after it has been activated.
Once you’ve tailored the code to your preferences, it’s time to configure when and where your animated background will be displayed.
Navigate to the Insertion section of your WPCode snippet. Ensure you select ‘Auto Insert’ as your Insert Method and choose ‘Site Wide Footer’ for the Location.
WPCode features a robust option called conditional logic, available in both free and premium versions. This allows you to specify exactly where your animated background will show up on your site.
To activate this feature, find the ‘Smart Conditional Logic’ section and switch ‘Enable Logic’ to on. You will see options to define specific conditions for displaying your background.
For instance, if you want the animated background to show only on your homepage, select ‘Page URL’ from the conditions dropdown, choose ‘Is,’ and input your homepage URL.
You can create multiple condition groups by clicking the ‘+ Add new group’ button.
The final step is to activate your code snippet. Locate the ‘Inactive’ toggle at the top of the page and click it to switch to ‘Active.’ Remember to click ‘Save Snippet’ to ensure your changes are saved.
That’s it! Check your website on both mobile and desktop to see your new animated background in action. Here’s a preview from our test site:
Do Animated Backgrounds Impact Website Speed?
If not implemented correctly, animated backgrounds can negatively affect your website’s loading speed. However, there are strategies to prevent this.
For particle backgrounds, the quantity of particles and their movement speed can influence your page’s loading time. More particles and quicker movement require additional processing power, which may slow down the site.
To optimize this, experiment with different settings for particle density and speed to determine what works best for your site. During this testing phase, consider running WordPress speed tests to assess the impact.
It’s also advisable to use animated backgrounds selectively, only on pages where they enhance the user experience. Overusing them may lead to a dull effect.
Finally, to maintain fast loading times with a particle background, be sure to adhere to best practices for website speed. You can find more information in our comprehensive guide on optimizing WordPress performance.
We trust this guide has shown you how to incorporate an animated particle background into your WordPress site. Additionally, you might find our article on obtaining website design feedback in WordPress helpful, along with our curated selection of the top WordPress theme builders.
If you enjoyed this article, consider subscribing to our YouTube Channel for more WordPress video tutorials. You can also connect with us on Twitter and Facebook.


