Troubleshooting CSS and JS Files Not Updating in Simple Custom CSS and JS
Content
If you've made changes to your custom CSS or JS code in the Simple Custom CSS and JS plugin, but those changes aren't appearing on your live website, you're not alone. This is a common issue often related to caching. This guide will explain why it happens and walk you through the most effective solutions.
Why Don't My Changes Appear Immediately?
The plugin is designed to update your site's frontend automatically. When you save a change, it creates a new file in the /wp-content/uploads/custom-css-js/ directory and uses a "cache-busting" technique. This means it adds a unique query string to the file URL (e.g., style.css?ver=123), which should force visitors' browsers to load the new version instead of a cached one.
However, several factors can interfere with this process:
- Aggressive Caching Plugins: Performance plugins (e.g., W3 Total Cache, WP Super Cache) can heavily cache static files like CSS and JS.
- Server-Level Caching: Your web host may employ its own server-side caching mechanisms.
- CDN Caching: Content Delivery Networks (CDNs) like Cloudflare serve static files from their own global networks.
- Browser Cache: Your local browser may be holding onto an old version of the file.
How to Fix It: Step-by-Step Solutions
1. Clear All Caches
This is the most common and effective first step. You must clear every cache between your plugin and the visitor.
- WordPress Caching Plugins: Locate the "Purge All Caches" or similar button in your caching plugin's settings (e.g., in W3 Total Cache).
- CDN Cache: If you use Cloudflare or another CDN, log into its dashboard and find the option to purge the cache.
- Server Cache: Some hosting providers have a caching system in their control panel (e.g., LiteSpeed Cache). Check your host's documentation or support pages for how to clear it.
- Browser Cache: Do a "hard refresh" on your site by pressing
Ctrl + F5(Windows) orCmd + Shift + R(Mac).
2. Manually Regenerate the Cache Files
Sometimes, the physical cache file in the uploads folder may not generate correctly. You can force the plugin to recreate it:
- Go to WP Admin -> Custom CSS & JS.
- Open each custom code you have edited for editing.
- Simply click the Update or Save button. This action regenerates the external file.
3. Check Your WordPress Address Settings
The plugin constructs the URL to external CSS/JS files based on your site's WordPress Address. If this is incorrect, it can cause issues, especially with HTTPS.
- Go to Settings -> General.
- Ensure both the WordPress Address (URL) and Site Address (URL) are identical and start with
https://if your site uses SSL.
4. Verify the Files Are Loading
To confirm whether your new code is even being output by the plugin, view your website's page source.
- Right-click on your webpage and select View Page Source.
- Press
Ctrl + F(Windows) orCmd + F(Mac) and search for a unique word or selector from your custom CSS code. - If you find it, the code is being output correctly, and the issue is purely visual due to caching. If you cannot find it, there may be a deeper problem with the plugin's configuration.
When All Else Fails
If you continue to experience problems after following these steps, consider these factors:
- Multisite Networks: The plugin can sometimes behave differently on WordPress Multisite installations. Try disabling and re-enabling the specific custom code on the affected site.
- File Permissions: In rare cases, the web server may not have write permissions to the
/wp-content/uploads/custom-css-js/folder, preventing it from creating new files. The required permission is usually 755, not 777.
By methodically working through these solutions, you should be able to resolve most issues related to CSS and JS updates not appearing on your site.
Related Support Threads Support
-
external scripts not httpshttps://wordpress.org/support/topic/external-scripts-not-https/
-
humanmade/S3-Uploads compatibilityhttps://wordpress.org/support/topic/humanmade-s3-uploads-compatibility/
-
Change JS-File after pubishing failedhttps://wordpress.org/support/topic/change-js-file-after-pubishing-failed/
-
custom css not showing on multisitehttps://wordpress.org/support/topic/custom-css-not-showing-on-multisite/
-
relative inclusion of snippets causes CSP issueshttps://wordpress.org/support/topic/relative-inclusion-of-snippets-causes-csp-issues/
-
CSS disappearshttps://wordpress.org/support/topic/css-disappears/
-
External Vs Internal filehttps://wordpress.org/support/topic/external-vs-internal-file/
-
@include with lesshttps://wordpress.org/support/topic/include-with-less/
-
Export and import custom css codehttps://wordpress.org/support/topic/export-and-import-custom-css-code/
-
All Custom Code List is Emptyhttps://wordpress.org/support/topic/all-custom-code-list-is-empty/
-
Issues with css/js changes when pushing to live sitehttps://wordpress.org/support/topic/issues-with-css-js-changes-when-pushing-to-live-site/
-
Pro VS Freehttps://wordpress.org/support/topic/pro-vs-free-4/
-
Not able to make multiple css fileshttps://wordpress.org/support/topic/not-able-to-make-multiple-css-files/
-
External CSS is cached and not updatinghttps://wordpress.org/support/topic/external-css-is-cached-and-not-updating/
-
How does the file(s) sequence works?https://wordpress.org/support/topic/how-does-the-files-sequence-works/
-
Merge several CSS fileshttps://wordpress.org/support/topic/merge-several-css-files/
-
777 The custom-css-js directory could not be createdhttps://wordpress.org/support/topic/777-the-custom-css-js-directory-could-not-be-created/
-
All Code Disappearedhttps://wordpress.org/support/topic/all-code-disappeared/
-
CSS External Filehttps://wordpress.org/support/topic/css-external-file/
-
export all CSS into 1 file?https://wordpress.org/support/topic/export-all-css-into-1-file/
-
double codeshttps://wordpress.org/support/topic/double-codes/
-
Import and Module ID’shttps://wordpress.org/support/topic/import-and-module-ids/
-
Custom CSS for Mailchimp Formhttps://wordpress.org/support/topic/custom-css-for-mailchimp-form/
-
css files aren’t removed from folderhttps://wordpress.org/support/topic/css-files-arent-removed-from-folder/
-
New file generated in uploads/custom-css-js folder every time CSS or JS is savedhttps://wordpress.org/support/topic/new-file-generated-in-uploads-custom-css-js-folder-every-time-css-or-js-is-saved/
-
Best way to create css?https://wordpress.org/support/topic/proper-way-to-create-css/
-
Speed optimization questionhttps://wordpress.org/support/topic/speed-optimization-question/
-
Access files (css and js) via ftphttps://wordpress.org/support/topic/access-files-css-and-js-via-ftp/
-
Conflicthttps://wordpress.org/support/topic/conflict-76/
-
CSS, JS Files not in folderhttps://wordpress.org/support/topic/css-js-files-not-in-folder/
-
!important; – still neededhttps://wordpress.org/support/topic/important-still-needed/
-
CSS code not having any effecthttps://wordpress.org/support/topic/css-code-not-having-any-effect/
-
Resource files result in mixed contenthttps://wordpress.org/support/topic/resource-files-result-in-mixed-content/
-
Caching?https://wordpress.org/support/topic/caching-25/
-
Recover Deleted CSS from Backuphttps://wordpress.org/support/topic/recover-deleted-css-from-backup/
-
Ability to combine CSS or JS into one linking filehttps://wordpress.org/support/topic/ability-to-combine-css-or-js-into-one-linking-file/
-
Where are the css and js files created with the pluginhttps://wordpress.org/support/topic/where-are-the-css-and-js-files-created-with-the-plugin/
-
CSS Not applying?https://wordpress.org/support/topic/css-not-applying/
-
linking external googleapis fileshttps://wordpress.org/support/topic/linking-external-googleapis-files/
-
2 files are createdhttps://wordpress.org/support/topic/2-files-are-created/
-
HPOS compatibilityhttps://wordpress.org/support/topic/hpos-compatibility-15/
-
File save css.https://wordpress.org/support/topic/file-save-css/
-
Import export all CSS JS and HTML code?https://wordpress.org/support/topic/import-export-all-css-js-and-html-code/
-
codes cached create issueshttps://wordpress.org/support/topic/codes-cached-create-issues/
-
Update CSS not workinghttps://wordpress.org/support/topic/update-css-not-working/
-
Css code export in txt datahttps://wordpress.org/support/topic/css-code-export-in-txt-data/
-
Permalink not in Source Codehttps://wordpress.org/support/topic/permalink-not-in-source-code/
-
Combine CSS & JS into single fileshttps://wordpress.org/support/topic/combine-css-js-into-single-files/