FOR DEVELOPERS
Transform your website’s speed and performance with Speedforseo, designed to deliver dramatic improvements effortlessl.
INSTALLING SPEEDFORSEO
Installing Speedforseo is Quick and Easy
Installing Speedforseo is Quick and Easy To install Speedforseo automatically,
log in to your WordPress admin panel and navigate to Plugins > Add New, then click Upload Plugin. Select the ZIP file you downloaded and click Install Now. Confirm the installation when prompted, and WordPress will handle the rest.
Once the plugin is activated, head over to the settings panel to start optimizing your website effortlessly!

Get Started with Speedforseo
Once you’ve activated SpeedForSEO, the first step is to run an ON/OFF test with the default settings and experience an immediate boost in your site’s speed!
See how much faster your site loads right out of the box. For advanced users familiar with browser rendering, you can fine-tune your setup using insights from tools like GTmetrix, Pingdom Tools, or Google PageSpeed Insights.
For consistent results, stick to one testing tool, run three consecutive tests, and take the average to accurately measure your website’s performance improvements.
Are there any recommended settings for Speedforseo?
Yes! Speedforseo works seamlessly with its default settings, offering substantial performance enhancements right from activation.
For advanced customization, you can adjust specific settings to suit your site’s needs and follow insights from tools like GTmetrix, Pingdom Tools, or Google PageSpeed Insights. Features like LazyLoad, JavaScript delay, and unused CSS removal can help you achieve peak performance.
Automatic Optimization Features
Speedforseo offers the following fully automated features:
- WebP support for modern image optimization
- Image quality control for efficient loading
- Image quality control for efficient loading
- CSS minification to reduce file size
- CSS minification to reduce file size
- Combining inline and third-party scripts for improved performance
- Merging Google Fonts to reduce HTTP requests
Settings Overview
Looking for a specific setting? Here’s a quick guide to where everything is located in Speedforseo:
‘General’ Tab
- License Key
- CDN URL
- Lazy Loading
- WebP Support
- Image Quality Control
- Excluded Pages
- Preload Resources
‘CSS’ Tab
- CSS Minification
- Additional CSS Optimizations
- Secondary CSS Optimization
- Combine Google Fonts
- Image Quality Control
- Excluded Pages
- Preload Resources
‘JS’ Tab
- JavaScript Minification
- Exclude JavaScript Tags
- Combine (Concatenate) JavaScript
- Delay JavaScript Tags
- Lazy Load JavaScript
‘Image Optimization’ Tab
- Image Optimization
Keep your Speedforseo plugin up-to-date
There are two ways to update Speedforseo: automatic and manual. If your license has expired, you can easily renew it through your account page.
Automatic Update
To update Speedforseo automatically, go to the Plugins page in your WordPress Dashboard (DOMAIN NAME/wp-admin/plugins.php).
Look for the update notification under the Speedforseo entry and click Update Now.
If you don’t see the update notification right away, try again in a few hours. Alternatively, go to Dashboard > Updates and click Check Again—this might trigger the notification to appear.
If the notification still doesn’t appear, it could be due to server restrictions blocking update requests. In that case, you can proceed with the manual update instead.
Manual Update
1. Update via FTP
- Visit your account page and download the latest version of Speedforseo.
- Unzip the archive, then upload the ‘speedforseo’ folder to the wp-content/plugins directory on your server.
2. Update via WP Admin
After downloading the latest version of Speedforseo from your account page, log in to your WordPress Admin Dashboard and follow these steps:
- Go to the Plugins page, deactivate and delete the existing Speedforseo plugin.
- Navigate to Plugins > Add New > Upload, upload the new .zip file, and activate the latest version of Speedforseo.
Update Notification Missing
In some cases, you may not see the update notification for Speedforseo in your WordPress admin panel. If this happens, you can force the update notification to appear. Visit the Plugins page in your WordPress admin and add the following query string to the end of the URL:
- ?speedforseo_force_update=1
For example, your URL should look like this:
- http://example.com/wp-admin/plugins.php?speedforseo_force_update=1
After refreshing the page, scroll down to the Speedforseo plugin entry, and you should see the update notification.
Unable to Upload/Install Speedforseo
Are you encountering an error message when trying to upload Speedforseo through your WordPress dashboard?
“The uploaded file exceeds the upload_max_filesize directive in php.ini.”
This message means there is a limit on the file size you can upload to your site. This limitation may be set at the site level or by your host. The Speedforseo zip file is just over 2MB so if the limit for your site is 2MB or less you would see this error message.
Quick Fix
To resolve this automatically, install the Increase Max Upload Filesize plugin: Increase Max Upload Filesize.
If the plugin doesn’t solve the issue, you have the following options:
- Upload Speedforseo via FTP.
- Contact your hosting provider to increase the upload limit.
- If you’re comfortable editing files, follow the manual steps below to increase the upload limit manually.
Manual Fix
How to Increase the Upload_Max_Filesize Limit:
You can increase the upload limit using one of the methods below. Depending on your server and host setup, one method may work better than others. You don’t need to try all these; just use the one that works for your site.
Important: Always back up your files before making any changes!
- .htaccess
Add this line to your .htaccess file:
php_value upload_max_filesize 10M
- php.ini File
If your hosting allows for a custom php.ini file, add this line:
upload_max_filesize = 10M
- wp-config.php
Add this code to your wp-config.php file:
@ini_set(‘upload_max_size’, ‘10M’);
- functions.php
If you’re using a child theme, add this to the functions.php file:
@ini_set(‘upload_max_size’, ‘10M’);
- Check Your Current Upload Limit
To verify that your upload limit has been successfully increased, go to:
Media > Add New
Under the upload area, you’ll see the Maximum upload file size displayed.
If the upload limit hasn’t changed after implementing one of the above methods, it means your hosting provider is controlling this setting. In that case, you’ll need to contact them directly for assistance.
What Does Speedforseo Do?
Speedforseo is a comprehensive WordPress performance optimization plugin packed with powerful features to boost your site’s speed:
- CDN Integration
- Image Optimization
- Lazy Loading
- WebP Support
- CSS Minification
- JavaScript Minification
- Defer JavaScript Parsing
- Serve Scaled Images
- Eliminate CSS @import
- Exclusion Options
- Site Debugging
- Google Fonts Optimization
- JavaScript Delay
Uninstalling Speedforseo
You can uninstall Speedforseo in two ways: via the WordPress admin panel or manually through FTP/File Manager.
From WordPress Admin
To uninstall Speedforseo, simply go to the Plugins page in the WordPress admin Dashboard. Speedforseo will automatically clean up after itself, removing any files, folders, and modifications (such as changes in the .htaccess or wp-config.php files).
Manually
If you choose to manually remove Speedforseo from the /wp-content/plugins/ folder, you will need to clean up manually as well. Here’s a list of things to remove/edit:
- Delete the /wp-content/cache/ and /wp-content/speedforseo-config/ folders.
- Delete the /wp-content/advanced-cache.php file.
- Edit the .htaccess file and remove everything between #BEGIN SPEEDFORSEO and #END SPEEDFORSEO.
- Edit the wp-config.php file, setting define(‘WP_CACHE’, true) to false or removing the line entirely.
- Delete the speedforseo_settings entry, as well as any transients and cronjobs in the WordPress options table of your database.
How to Find the Best Settings for Your Site?
So, you’ve activated Speedforseo, and now you’re asking, “What’s the optimal setup for my site?”
Every website is unique, with different themes, plugins, and content. The best settings will vary depending on your specific setup. Here’s a guide to safely experimenting with the most commonly used Speedforseo settings.
1. Key Considerations:
- The primary goal is to make your site faster. Activating more options doesn’t always translate to better performance, so don’t worry if you can’t enable everything.
- Use reliable tools like GTmetrix, Pingdom Tools, or Google PageSpeed Insights to measure your website’s load times and obtain detailed performance reports.
2. Steps to Optimize:
- Benchmark Tests: Start by running speed tests to establish a baseline for your website’s performance.
- Experiment with Settings: Gradually enable Speedforseo features, testing their impact one by one.
- Evaluate Results: After applying optimizations, test your site again to measure improvements in speed.
Best Practices for Configuring Speedforseo
When testing and configuring Speedforseo settings, follow this step-by-step approach to ensure optimal results and avoid issues:
1. Activate Options Gradually:
Enable settings one at a time instead of all at once.
2. Test Your Site After Each Change:
After activating a setting, view your site in a browser where you’re not logged in to WordPress. Using an incognito or private browsing window works best. This allows you to identify any potential issues immediately.
3. Check Multiple Page Types:
Review different pages on your site (e.g., home, blog, product pages) to ensure everything looks and functions correctly.
4. Troubleshoot Issues Quickly:
If something doesn’t look right, don’t worry—simply disable the last activated option, and your site will return to normal.
Getting Started with Speedforseo Configuration
General -> Image Optimization
Enable Lazy Loading for images, iframes, and videos to improve performance by loading these elements only when they are needed (i.e., when the visitor scrolls to them). This reduces the initial load time and improves user experience.
Additional options include:
- Automatically optimizing images when they are uploaded.
- Excluding specific images from optimization if required.
CSS -> CSS Optimization
- Activate CSS Minification to reduce file size and improve load times.
- Define specific rules for minification and exclude certain CSS files if necessary.
- Adjust settings for loading secondary CSS, including options to delay its loading to prioritize essential resources.
JavaScript > JS Optimization
- Enable JS Minification to compress JavaScript files for faster delivery.
- Use the Defer Parsing of JavaScript option to prevent non-essential scripts from delaying page rendering.
- Exclude specific JavaScript files from combining and set rules for when combined scripts should load.
- Configure JS Tag Delays to control how long scripts are deferred for enhanced performance.
GENERAL SETTINGS
1. License Key
A valid License Key is required to activate your plugin. Each license key is tied to a specific product
configuration and is auto-generated upon successful order completion. You can find the key in the “Order Completed” email sent by Speedforseo.
2. Enable Optimization
Activate optimization to enable core features like JS & CSS minification, critical CSS generation, and automatic image conversion to WebP without compromising quality. These options can also be customized individually.
3. Optimize Pages with Query Parameters
Enables optimization for pages with query parameters. Recommended for high-performance servers only.
4. Optimize Pages for Logged-In Users
Allows optimization for logged-in users. Use with caution.
5. Separate Cache for Mobile
Generates separate JavaScript and CSS caches, including critical CSS, for mobile and desktop.
6. CDN URL
Add your CDN URL to enhance delivery speed and resource availability.
7. Exclude File Extensions from CDN
Exclude specific file extensions (e.g., .woff, .ttf, .eot, .woff2) to prevent conflicts during CDN integration.
8. Minify HTML
Reduces the size of HTML files to speed up loading times.
9. Leverage Browser Caching
Automatically configures browser caching for optimal performance.
10. Enable Gzip Compression
Activates Gzip compression to reduce file sizes. This feature works on Apache servers.
11. Remove Query Parameters
Automatically removes query parameters from CSS and JS files to improve caching efficiency.
12. Enable Lazy Loading
Lazy loads images, iframes, videos, and audio to improve initial page load times.
13. Lazy Load Pixels Below Viewport
Starts lazy loading resources 200 pixels below the viewport by default. This can be adjusted for faster loading.
14. WebP Support
Converts .jpg and .png images to WebP format for enhanced performance.
15. WebP Image Quality
Maintains image quality at 90% by default, with customizable settings.
16. Optimize JPG/PNG Images
Optimizes .jpg and .png images for better loading times.
17. Optimize Images via WP-Cron
Uses WP-Cron to optimize one image per minute, ensuring server performance remains unaffected. Faster optimization is available via the “Start Optimization” button.
18. JPG/PNG Image Quality
Keeps image quality at 90% by default, with an option to adjust as needed.
19. Optimize Images on the Go
Automatically identifies and optimizes unoptimized images as pages are loaded. Recommended to disable this after a few days.
20. Automatic Image Optimization on Upload
Automatically optimizes and converts images to WebP format during uploads. Ensure relevant settings are enabled.
21. Responsive Images
Creates responsive images that adapt to different screen sizes for improved user experience.
22. Preload Resources
Preload resources like images, CSS, JS, or fonts by adding their URLs in the “Preload Resources” section, one per line.
23. Exclude Images from Lazy Loading
Exclude specific images from lazy loading by specifying their URL, class name, ID, or alt attribute (e.g., xyz.png, nolazy).
24. Exclude Pages from Optimization
Exclude specific pages from optimization by entering their URLs (e.g., /cart, /login).
25. Cache Path
The plugin stores its cache in the WP Content cache folder by default. You can customize the cache path by entering a full directory path.
CSS Optimization
1. Enable CSS Minification
Activate this option to reduce the size of your CSS files through minification, optimizing site performance.
2. Load Critical CSS
Automatically generates and loads Critical CSS in a .css file to improve loading times for above-the-fold content.
3. Load Critical CSS in Style Tag
Choose to load Critical CSS directly within a style tag instead of a separate .css file.
4. Create Critical CSS Button
Use this button to generate Critical CSS for your site. Ensure you crawl all pages, clear WordPress and server/CDN caches, and then click “Create Critical CSS Now” for optimal results.
5. Exclude CSS from Minification
Exclude specific CSS files from minification or lazy loading by entering their URLs (e.g., xyz.css) in the designated section.
6. Force Lazy Load for CSS Files
Force lazy loading for data-heavy CSS files like FontAwesome.css or Icons.css to reduce initial load times.
7. Combine Google Fonts
Automatically combine and load all Google Fonts used on your site for faster performance.
8. Delay Google Fonts Loading
Set a delay (in seconds) for loading Google Fonts, ensuring faster initial page loads.
9. Load Style Tags in Head to Avoid CLS
Prevent Cumulative Layout Shift (CLS) by loading specific style tags in the head. Add the IDs of the style tags, each on a new line, in the provided section.
10. Exclude Pages from Combined CSS Loading
Exclude specific pages or parts of URLs from CSS optimization by entering them in this section. Each URL or URL fragment should be added on a new line.
11. Custom Preload CSS
If you need to preload specific CSS, simply add it in this section without wrapping it in a style tag.
JS Optimization
1. Enable JS Minification
Activate this option to minify JavaScript files, reducing file size and improving load speed.
2. Exclude JavaScript Tags from Combine
Easily exclude specific JavaScript files from lazy loading or minification by entering their URLs (e.g., xyz.js) in the provided section.
3. Preload Custom JavaScript
Add any custom JavaScript scripts you want to preload in this section, without including the script tag.
4. Exclude Inline JavaScript from Combine
Exclude specific inline JavaScript from optimization by entering its script name or part of the URL. You can add attributes such as defer (e.g., jquery.min.js defer) or full to prevent minification (e.g., jquery.min.js full). Note: Use only one word after a space.
5. Force Lazy Load for JavaScript
Force lazy loading for heavy JavaScript files or inline scripts (e.g., social media scripts like Facebook or Instagram). Add identifiers such as keywords, IDs, or URLs to this section to enhance load speed.
6. Load Combined JavaScript
Choose when to load combined JavaScript:
- On Page Load: Loads JavaScript with the page for general optimization.
- After Page Load: Improves scores on tools like Google PageSpeed Insights. Use the “after page load” option cautiously, as it may affect functionality.
7. Exclude Pages from JavaScript Optimization
Exclude specific pages or scripts from JavaScript minification and lazy loading. Enter the full or partial URLs of the scripts, with each one on a new line.
8. Custom JavaScript
Add any custom JavaScript you want to load either after the page load or on user interaction in this section, without including the script tag.
Cache
1. Delete JS/CSS Cache
The Speedforseo plugin provides an option to clear the combined and minified JavaScript and CSS cache. This ensures that any changes made to theme or plugin files are updated and reflected on your website.
2. Delete Critical CSS
Easily delete the Critical CSS using the plugin. It is recommended to use this option only when you’ve made changes to the styles that affect the upper half of your webpage to ensure accurate rendering.
Plugin Hooks
Speedforseo enables code modifications for your webpage by simply adding the required code to the functions.php file. You can do this via the Theme File Editor or a File Manager.
Change value of main variable
Function: Speedforseo_customize_add_settings
Description: Customize variables and paths (URLs) effortlessly using the
Speedforseo_customize_add_settings function. This function allows you to modify plugin settings to align with your requirements.
Parameter: $settings – Represents the plugin’s settings.
Return: $settings – Updates to reflect the changes applied to variables and paths.
function Speedforseo_customize_add_settings($settings){
$settings = str_replace(array(“mob.css”),array(“mobile.css”), $settings);
return $settings;
}
Enable webp
Function: Speedforseo_disable_htaccess_webp
Description: The Speedforseo plugin converts .jpg and .png formats to WebP without altering the original URL structure. This function disables WebP rendering through .htaccess.
Return: true – Appends w3.webp to the URL, e.g., xyz.jpgw3.webp.
function w3_disable_htaccess_wepb(){
return true;
}
Change the html before the optimization
Function: Speedforseo_before_start_optimization
Description: Speedforseo enables you to modify the HTML of your site before starting the optimization process. For example, you can replace or add elements to the HTML.
Speedforseo_customize_add_settings function. This function allows you to modify plugin settings to align with your requirements.
Parameter: $html – The complete HTML content of the page.
Return: $true – Applies the changes made to the HTML of the page.
function Speedforseo_before_start_optimization($html){
$html = str_replace(array(""),array(""), $html);
return $html;
}
Change the html after the optimization
Function: Speedforseo_after_optimization
Description: Speedforseo allows you to modify the HTML of your site after the page has been optimized by the plugin. For example, you can replace or add elements to the HTML.
Speedforseo_customize_add_settings function. This function allows you to modify plugin settings to align with your requirements.
Parameter: $html – The complete HTML content of the page.
Return: $true – Applies the changes made to the HTML of the page.
function Speedforseo_after_optimization($html){
$html = str_replace(array(image.png''),array(image-100x100.png''), $html);
return $html;
}
Exclude pages form critical css
Function: w3_no_critical_css
Description: Speedforseo allows you to exclude specific pages from generating Critical CSS, such as search pages.
Parameter: $url – Stores the URL of the page.
Return: $true – Excludes the page from creating Critical CSS.
function w3_no_critical_css($url){
if(strpos($url,’/path/’) !==false) {
return true;
}
}
Exclude pages form optimization
Function: Speedforseo_exclude_page_optimization
Description: Speedforseo allows you to exclude specific pages from optimization, such as cart or login pages.
Parameter: $url – The URL of the page.
Return: $true – Excludes the page from optimization.
Return: $false – Does not exclude the page from optimization.
function Speedforseo_exclude_page_optimization($url){
if(!empty($_REQUEST['//Path//'])){
return true;
}
return false;
}
Exclude pages form optimization
Function: Speedforseo_image_exclude_lazyload
Description: Speedforseo allows you to dynamically exclude specific images from lazy loading, so you can choose which images you don’t want to optimize.
Parameter: $path – The path of the image.
Return: $true – The image will be lazy-loaded.
Return: $false – The image will not be lazy-loaded.
function Speedforseo_image_exclude_lazyload($path){
if(!empty($path) && strpos($path,’logo.png’) !== false){
return true;
}
return false;
}
Create separate critical css for page and post
Function: w3_create_separate_critical_css_of_post_type
Description: By default, Speedforseo generates a single critical CSS for posts. However, if you’d like to generate separate critical CSS for each individual post, Speedforseo allows you to create critical CSS on a post-by-post basis.
Return: array – Creates separate critical CSS for each post and page.
function w3_create_separate_critical_css_of_post_type(){
return array('page','post','custom-post');
}
Create separate critical css for categories
Function: w3_create_separate_critical_css_of_category
Description: Speedforseo enables you to generate separate critical CSS for each category, allowing for more granular control over your website’s performance optimization.
Parameter: $category – The category for which to generate separate critical CSS.
Return: array – Generates separate critical CSS for each category.
function w3_create_separate_critical_css_of_category(){
return array('category','tag','custom-category');
}
Exclude JS files from optimization
Function: Speedforseo_exclude_javascript_filter
Description: If you wish to dynamically exclude a JavaScript file or inline script from optimization, Speedforseo allows you to easily do so (for example, with scripts like revslider).
Parameter: $exclude_js – Boolean indicating whether the JavaScript should be excluded from optimization.
Parameter: $script_obj – The JavaScript script in object format.
Parameter: $script – The content of the JS file you want to exclude.
Parameter: $html – The content of the webpage.
Return: $exclude_js – Indicates whether the JavaScript has been successfully excluded from optimization.
function Speedforseo_exclude_javascript_filter($exclude_js,$script_obj,$script,$html){
if(wp_is_mobile()){
if(strpos($script,'jquery-core-js') !== false || strpos($script,'/revslider/') !== false){
return 0;
}
}
return $exclude_js;
}
Make changes in external JS files
Function: w3_external_javascript_customize
Description: If you need to make changes to your external JavaScript tags, Speedforseo provides the ability to customize them as required.
Parameter: $script_obj – Boolean indicating whether the JavaScript should be excluded from optimization.
Parameter: $script_obj – The JavaScript script in object format.
Parameter: $script – The content of the JS file you want to modify.
Return: $script_obj – Reflects the changes made in the external JavaScript file.
function w3_external_javascript_customize($script_obj, $script){
if(strpos($script,'//text//') !== false){
$script = str_replace(' ',' ',$script);
}
return $script_obj;
}
Make changes in inline JS script tags
Function: Speedforseo_inner_js_customize
Description: If you wish to modify your inline JavaScript, Speedforseo allows you to make adjustments to the inline script. To identify the script, you can enter a unique text snippet from it.
Parameter: $script – The content of the inline JavaScript you want to modify.
Return: $script – The modified content of the inline JavaScript.
function Speedforseo_inner_js_customize($script){
if(strpos($script'//unique word from script//') !== false){
$script = str_replace(''jQuery(window) ', 'jQuery(document)',$script);
}
return $script;
}
Make changes in css files
Function: Speedforseo_internal_css_customize
Description: If you want to modify your CSS files, Speedforseo allows you to make changes in the stylesheet files.
Parameter: $css – The content of the inline JavaScript you want to modify.
Parameter: $path – The content of the CSS file you wish to modify.
Return: $css – The modified content of the CSS file.
function Speedforseo_internal_css_customize($css,$path){
if(strpos($path,' //cssPath // ') !== false){
$css = str_replace(' ',' ',$css);
}
return $css;
}
Exclude css files from minification only
Function: Speedforseo_internal_css_minify
Description: If you don’t want to minify a particular CSS file, Speedforseo allows you to exclude it from the minification process.
Parameter: $css – The content of the CSS file.
Parameter: $path – The path to the CSS file.
Return: true – it will exclude the entered css file from minification.
Return: false – it will not exclude the entered css file from minification.
function Speedforseo_internal_css_minify($path,$css){
if(strpos($path,'//cssPath//') !== false){
return false;
}
return true;
}
Make changes in created critical css files
Function: Speedforseo_customize_critical_css_filename
Description: If you wish to modify the filename of the Critical CSS file, Speedforseo provides an option to customize it. By default, Speedforseo generates filenames for critical CSS, but you can use this function to change the filename to suit your preferences.
Parameter: $critical_css_filename – File name of the critical css.
Return: $critical_css_filename – New name of the critical css file.
function Speedforseo_customize_critical_css_filename($critical_css_filename){
$critical_css_filename = str_replace(' ',' ',$critical_css_filename);
return $critical_css_filename;
}
Make changes in created critical css in style tag
Function: Speedforseo_customize_critical_css
Description: If you wish to modify the generated Critical CSS, Speedforseo allows you to make changes. For example, you can replace or remove specific strings or URLs in the Critical CSS (e.g., change @font-face { font-family:”Courgette”; to @font-face {).
Parameter: $critical_css – Critical Css of the page.
Return: $critical_css – The updated Critical CSS reflecting the changes.
function Speedforseo_customize_critical_css($critical_css){
$critical_css = str_replace('@font-face { font-family:"Courgette";', ' ',$critical_css);
return $critical_css;
}
Quick Link
- About Us
- Contact US
- Privacy Policy
- Trems & Conditiion
Subscribe to our newsletter.