Phone Orders For WooCommerce

Disable LiteSpeed Cache & Rank Math SEO at frontend checkout

Phone Orders for WooCommerce can create a dedicated frontend page where your agents place manual orders without accessing the WordPress admin dashboard. This is ideal for call centres, customer service desks, or any workflow where operators should not see the back end. However, performance and SEO plugins often interfere with this frontend order page, causing broken layouts, caching problems, or incorrect price displays.

The code snippet in this guide selectively disables LiteSpeed Cache and Rank Math SEO when the agent visits your custom frontend page. It leaves all other performance and SEO features active everywhere else on your site.


Why You Might Need to Disable These Plugins

LiteSpeed Cache

LiteSpeed Cache dramatically speeds up your store, but aggressive caching can cause serious issues on dynamic pages such as the Phone Orders frontend page:

  • Outdated cart totals – The page may display stale prices if the server serves a cached version.
  • Broken AJAX search – Customer and product search functions rely on real‑time requests, which caching can block or delay.
  • Interference with the add‑to‑cart process – A cached page may not reflect items the agent has just added to the order.
  • Logged‑in state issues – The cache may mistakenly serve a page intended for a different agent’s session.

Disabling LiteSpeed Cache on this specific page prevents all such problems while keeping the cache active for the rest of your store.

Rank Math SEO

Rank Math injects SEO metadata, schema markup, and analytics code into every page of your site. On the Phone Orders frontend page, this extra code is not only unnecessary but also harmful:

  • Confusing search engine crawlers – The page contains no product or category content that should be indexed.
  • Slower page load times – Unnecessary scripts and styles add overhead.
  • Potential duplicate content issues – Search engines might mistakenly treat this internal page as part of your catalogue.

Disabling Rank Math on the frontend page keeps your store’s SEO clean and ensures the page loads as fast as possible for your agents.


Prerequisites

Before you add the code, complete the following steps:

  • Enable the frontend page – In Phone Orders → Settings → Run at frontend, mark the first checkbox. A new page with the default slug phone-orders-frontend-page becomes available. You can customise the slug in the same settings area.
  • Know the slug of your frontend page – The code uses this slug to determine when to disable the plugins. The default value is phone-orders-frontend-page. If you changed it, note the new slug.
  • Identify the correct plugin file paths – The code needs the exact folder and main file name of each plugin you want to disable.

Finding the Correct Plugin File Paths

PluginTypical Path
LiteSpeed Cachelitespeed-cache/litespeed-cache.php
Rank Math SEO (free)seo-by-rank-math/rank-math.php
Rank Math SEO (Pro)seo-by-rank-math-pro/rank-math-pro.php

To confirm the path for any plugin:

  1. Go to Plugins → Installed Plugins.
  2. Hover over the plugin name and look at the browser’s status bar or the URL of the Edit link. The path appears as plugin=plugin-folder/plugin-file.php.
  3. Alternatively, use FTP or your hosting file manager to browse /wp-content/plugins/ and locate the plugin’s folder and main file.

The Complete Code Snippet

Copy and paste the following code into your child theme’s functions.php file or via the Code Snippets plugin.


What the Code Does

The code attaches a custom function to the option_active_plugins filter, which runs very early in the WordPress loading process.

ElementExplanation
add_filter( 'option_active_plugins', ... )Modifies the list of active plugins stored in the database before WordPress activates them.
$disabled_url = "phone-orders-frontend-page"Stores the slug of your frontend order page. Change this if you use a different slug.
strpos( $_SERVER['REQUEST_URI'], $disabled_url ) !== falseChecks whether the current URL contains the specified slug. The filter only runs on that exact page.
$plugins_to_disable = array( ... )Lists the exact plugin file paths to disable. Only include the plugins that cause interference.
array_search( $plugin, $plugins )Finds the position of each plugin in the active plugin list.
unset( $plugins[ $key ] )Removes the plugin from the list, so WordPress does not load it for this request.
return $pluginsReturns the modified list of active plugins.

The filter does not deactivate the plugins permanently. It only prevents them from loading when a visitor (or agent) accesses the designated frontend page. All other pages of your store receive the full performance and SEO benefits.


Step‑by‑Step Implementation

Step 1: Choose where to add the code

  • Option A (Recommended): Use the free Code Snippets plugin. Install it from Plugins → Add Newby searching for “Code Snippets”. This method is safe and allows you to enable or disable the snippet without touching your theme files.
  • Option B: Add the code to your child theme’s functions.php file. Never add custom code directly to a parent theme, because updates will erase your changes.

Step 2: Insert the snippet

  • If using Code Snippets:
  • If editing functions.php:

Step 3: Test the functionality

  1. Open a private or incognito browser window (to avoid logged‑in cache).
  2. Visit your frontend order page, for example https://yourstore.com/phone-orders-frontend-page.
  3. Verify that the page loads correctly and that the customer/product search works.
  4. Use your browser’s developer tools (F12 → Network tab) to confirm that no LiteSpeed or Rank Math scripts or styles load on this page.
  5. Visit another page of your store (e.g., a product or the shop page) to confirm that LiteSpeed and Rank Math still work there.

Have questions? Please submit a support request. We're always happy to help!

Phone Orders
for WooCommerce
PRO

From $120
Buy
✓ 30-day money-back guarantee