{"id":51442,"date":"2025-09-28T10:01:05","date_gmt":"2025-09-28T07:01:05","guid":{"rendered":"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/"},"modified":"2025-09-28T10:01:06","modified_gmt":"2025-09-28T07:01:06","slug":"common-opencart-issues-in-wordpress-and-fixes","status":"publish","type":"post","link":"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/","title":{"rendered":"Common Opencart Issues in WordPress and Fixes"},"content":{"rendered":"<p><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#When_opencart_and_wordpress_Share_a_Site_What_Usually_Goes_Wrong\" >When opencart and wordpress Share a Site: What Usually Goes Wrong<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#permalinks_htaccess_and_404_Errors\" >permalinks, .htaccess and 404 Errors<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#Fix_Exclude_OpenCart_folder_from_WordPress_rewrite_rules\" >Fix: Exclude OpenCart folder from WordPress rewrite rules<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#Sessions_Cookies_and_Lost_Carts_especially_with_caching\" >Sessions, Cookies and Lost Carts (especially with caching)<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#Fixes\" >Fixes<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#Mixed_Content_https_and_Redirect_Loops\" >Mixed Content, https and Redirect Loops<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#Fix_Standardize_the_protocol\" >Fix: Standardize the protocol<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#SEO_Conflicts_and_Duplicate_Content\" >SEO Conflicts and Duplicate Content<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#Fixes_for_SEO_conflicts\" >Fixes for SEO conflicts<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#Theme_and_Styling_Mismatches\" >Theme and Styling Mismatches<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#Practical_fixes\" >Practical fixes<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#PHP_Version_Extensions_and_Compatibility_Errors\" >PHP Version, Extensions and Compatibility Errors<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#How_to_resolve_compatibility_problems\" >How to resolve compatibility problems<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#File_Permissions_Upload_Errors_and_Image_Paths\" >File Permissions, Upload Errors and Image Paths<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#Permission_and_path_fixes\" >Permission and path fixes<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#ajax_cors_and_API_Problems\" >ajax, cors and API Problems<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#Fixes-2\" >Fixes<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#Practical_Integration_Patterns_to_Avoid_Problems\" >Practical Integration Patterns to Avoid Problems<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#Quick_Troubleshooting_Checklist\" >Quick Troubleshooting Checklist<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#Summary\" >Summary<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#FAQs\" >FAQs<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#1_Can_I_run_OpenCart_and_WordPress_on_the_same_domain_without_conflicts\" >1. Can I run OpenCart and WordPress on the same domain without conflicts?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#2_Why_does_my_cart_empty_when_I_enable_a_WordPress_caching_plugin\" >2. Why does my cart empty when I enable a WordPress caching plugin?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#3_I_upgraded_PHP_and_OpenCart_broke_What_should_I_do\" >3. I upgraded PHP and OpenCart broke. What should I do?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#4_How_do_I_avoid_duplicate_content_between_WordPress_and_OpenCart\" >4. How do I avoid duplicate content between WordPress and OpenCart?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/infinitydomainhosting.com\/kb\/common-opencart-issues-in-wordpress-and-fixes\/#5_Can_I_share_login_or_cart_state_between_WordPress_and_OpenCart\" >5. Can I share login or cart state between WordPress and OpenCart?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"When_opencart_and_wordpress_Share_a_Site_What_Usually_Goes_Wrong\"><\/span>When <a href=\"https:\/\/www.a2hosting.com\/opencart-hosting\/\" target=\"_blank\" rel=\"noopener\">opencart<\/a> and <a href=\"https:\/\/www.hostinger.com\/tutorials\/what-is-wordpress\" target=\"_blank\" rel=\"noopener\">wordpress<\/a> Share a Site: What Usually Goes Wrong<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>Running OpenCart and WordPress together , whether OpenCart is installed in <a href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-configure-2fa-step-by-step\/\">a<\/a> subfolder, on a <a href=\"https:\/\/www.a2hosting.com\/blog\/when-to-use-subdomains\/\" target=\"_blank\" rel=\"noopener\">subdomain<\/a>, or being integrated into WordPress templates , solves many business needs but creates a set of recurring problems. These typically revolve around <a href=\"https:\/\/www.hostinger.com\/tutorials\/what-is-a-url\" target=\"_blank\" rel=\"noopener\">url<\/a> rewrites and .<a href=\"https:\/\/www.a2hosting.com\/kb\/developer-corner\/apache-web-server\/using-htaccess-files\/\" target=\"_blank\" rel=\"noopener\">htaccess<\/a> collisions, lost shopping sessions when page <a href=\"https:\/\/infinitydomainhosting.com\/kb\/understanding-website-caching-and-website-performance-optimization\/\">caching<\/a> is active, mixed content and <a href=\"https:\/\/www.hostinger.com\/tutorials\/what-is-ssl\" target=\"_blank\" rel=\"noopener\">ssl<\/a> mismatches, <a href=\"https:\/\/hostadvice.com\/blog\/web-hosting\/php\/which-php-version\/\" target=\"_blank\" rel=\"noopener\">php version<\/a> and extension compatibility, and SEO duplication between product pages and WordPress content. The good news is that most problems are configuration-level and can be fixed without rewriting either platform.<\/p>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"permalinks_htaccess_and_404_Errors\"><\/span><a href=\"https:\/\/www.a2hosting.com\/kb\/installable-applications\/optimization-and-configuration\/wordpress2\/configuring-wordpress-permalink-structure\/\" target=\"_blank\" rel=\"noopener\">permalinks<\/a>, .<a href=\"https:\/\/www.a2hosting.com\/kb\/developer-corner\/apache-web-server\/using-htaccess-files\/\" target=\"_blank\" rel=\"noopener\">htaccess<\/a> and 404 Errors<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>A very common scenario: WordPress uses mod_rewrite rules in .htaccess for \u201cpretty\u201d permalinks and those rules unintentionally capture requests meant for OpenCart, producing 404s, broken routes, or admin login failures. If OpenCart is running in \/shop or a subdirectory, the easiest approach is to scope WordPress\u2019 rewrite rules so they don\u2019t touch that folder, or place OpenCart on a subdomain to fully separate URL handling.<\/p>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Fix_Exclude_OpenCart_folder_from_WordPress_rewrite_rules\"><\/span>Fix: Exclude OpenCart folder from WordPress rewrite rules<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Edit the WordPress .htaccess in your site root and add an exclusion for the OpenCart directory above the WordPress rules. Example:<\/p>\n<p><\/p>\n<pre><code># BEGIN WordPress<br \/>\n&lt;IfModule mod_rewrite.c&gt;<br \/>\nRewriteEngine On<br \/>\n# Exclude OpenCart directory<br \/>\nRewriteRule ^(shop|ocfolder)\/(.*)$ - [L]<br \/>\nRewriteBase \/<br \/>\nRewriteRule ^index.<a href=\"https:\/\/www.hostinger.com\/tutorials\/what-is-php\/\" target=\"_blank\" rel=\"noopener\">php<\/a>$ - [L]<br \/>\nRewriteCond %{REQUEST_FILENAME} !-f<br \/>\nRewriteCond %{REQUEST_FILENAME} !-d<br \/>\nRewriteRule . \/index.php [L]<br \/>\n&lt;\/IfModule&gt;<br \/>\n# END WordPress<\/code><\/pre>\n<p><\/p>\n<p>Replace shop|ocfolder with your actual OpenCart directory <a href=\"https:\/\/www.hostinger.com\/domain-name-search\" target=\"_blank\" rel=\"noopener\">name<\/a>. If OpenCart is in the root, consider moving <a href=\"https:\/\/support.hostinger.com\/en\/articles\/1863967-how-to-point-a-domain-to-hostinger\" target=\"_blank\" rel=\"noopener\">it to<\/a> a subdirectory or using a subdomain to simplify rules.<\/p>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Sessions_Cookies_and_Lost_Carts_especially_with_caching\"><\/span>Sessions, Cookies and Lost Carts (especially with caching)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>Users often complain that items disappear from the <a href=\"https:\/\/infinitydomainhosting.com\/cart.php\">cart<\/a>, the store logs them out randomly, or carts don\u2019t persist across pages. These behaviors frequently result from server-side sessions being cleared or from full-page <a href=\"https:\/\/infinitydomainhosting.com\/kb\/using-website-caching-plugins-and-software-for-wordpress-joomla-etc\/\">caching plugins<\/a> (or server edge caches like Varnish or Cloudflare) delivering cached <a href=\"https:\/\/www.hostinger.com\/tutorials\/what-is-html\" target=\"_blank\" rel=\"noopener\">html<\/a> instead of dynamic cart state. Another common cause is conflicting cookie <a href=\"https:\/\/www.hostinger.com\/domain-name-search\" target=\"_blank\" rel=\"noopener\">domains<\/a> or paths when the two systems run under different <a href=\"https:\/\/www.hostinger.com\/tutorials\/what-is-a-url\" target=\"_blank\" rel=\"noopener\">urls<\/a> (www vs non-www or <a href=\"https:\/\/www.a2hosting.com\/domains\/\" target=\"_blank\" rel=\"noopener\">domain<\/a> vs subdomain).<\/p>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Fixes\"><\/span>Fixes<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<ul><\/p>\n<li>Exclude OpenCart routes from any WordPress cache plugins (WP Super Cache, W3 Total Cache, <a href=\"https:\/\/www.a2hosting.com\/litespeed-hosting\/\" target=\"_blank\" rel=\"noopener\">litespeed<\/a> Cache). Configure the plugin to bypass \/shop\/* or specific cart\/checkout endpoints.<\/li>\n<p><\/p>\n<li>If using Cloudflare or CDNs, create page rules to bypass cache for cart, account, checkout URLs and set Cache-Control headers appropriately.<\/li>\n<p><\/p>\n<li>Ensure cookie <a href=\"https:\/\/support.hostinger.com\/en\/articles\/1583424-what-are-the-differences-between-subdomain-parked-domain-and-add-on-domain\" target=\"_blank\" rel=\"noopener\">domain and<\/a> path in OpenCart config.php match the <a href=\"https:\/\/www.hostinger.com\/tld\/site-domain\" target=\"_blank\" rel=\"noopener\">site domain<\/a>. Example: set cookie <a href=\"https:\/\/www.a2hosting.com\/domains\/\" target=\"_blank\" rel=\"noopener\">domain<\/a> to &#8216;.example.com&#8217; to work with <a href=\"https:\/\/www.a2hosting.com\/blog\/when-to-use-subdomains\/\" target=\"_blank\" rel=\"noopener\">subdomains<\/a>.<\/li>\n<p><\/p>\n<li>Check <a href=\"https:\/\/www.a2hosting.com\/kb\/developer-corner\/php\/using-php-sessions\/\" target=\"_blank\" rel=\"noopener\">php session<\/a> settings: session.save_path must be writable, session.gc_maxlifetime should meet your expected session length, and unique session names can avoid collisions.<\/li>\n<p>\n<\/ul>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Mixed_Content_https_and_Redirect_Loops\"><\/span>Mixed Content, <a href=\"https:\/\/www.hostinger.com\/tutorials\/what-is-ssl\" target=\"_blank\" rel=\"noopener\">https<\/a> and Redirect Loops<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>When WordPress is forced to HTTPS while OpenCart configuration still references HTTP (or vice versa), browsers will show mixed content errors, or you may get redirect loops. OpenCart has both HTTP_SERVER and HTTPS_SERVER values in its config.php; those must reflect your current protocol and domain. Similarly, WordPress&#8217;s Site Address and WordPress Address must match the scheme you want visitors to use.<\/p>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Fix_Standardize_the_protocol\"><\/span>Fix: Standardize the protocol<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Edit OpenCart\u2019s config.php and admin\/config.php to match your HTTPS settings, for example:<\/p>\n<p><\/p>\n<pre><code>define('HTTP_SERVER', '<br \/>\ndefine('HTTPS_SERVER', '<\/code><\/pre>\n<p><\/p>\n<p>Also ensure WordPress Settings \u2192 General uses https:\/\/ if the site is SSL-protected. If a mixed environment is necessary, use protocol-relative or relative URLs for embedded assets where appropriate, and update external links and canonical tags to the HTTPS version. Finally, if you run into redirect loops, temporarily turn off <a href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-set-up-a-website-with-custom-redirects-for-improved-website-navigation-and-user-experience\/\">redirects<\/a> (both in WordPress and server) and fix the config files first.<\/p>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"SEO_Conflicts_and_Duplicate_Content\"><\/span>SEO Conflicts and Duplicate Content<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>If product pages in OpenCart are indexed alongside WordPress pages that describe the same products or categories, search engines can penalize duplicate content or prefer the less optimal page. Another problem arises when both systems generate XML sitemaps with overlapping URLs, or when canonical tags aren\u2019t set correctly.<\/p>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Fixes_for_SEO_conflicts\"><\/span>Fixes for SEO conflicts<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<ul><\/p>\n<li>Decide which platform will be the canonical source for shop pages. If OpenCart serves products, make OpenCart pages canonical and use robots.txt or meta tags to prevent WordPress from indexing duplicate pages.<\/li>\n<p><\/p>\n<li>Add canonical tags on OpenCart product pages pointing to the correct URL. Many SEO extensions for OpenCart handle this automatically.<\/li>\n<p><\/p>\n<li>Combine or submit separate sitemaps in <a href=\"https:\/\/support.hostinger.com\/en\/articles\/3692620-how-to-add-a-domain-to-google-search-console\" target=\"_blank\" rel=\"noopener\">google search console<\/a>, but ensure each <a href=\"https:\/\/www.hostinger.com\/tutorials\/what-is-a-sitemap\" target=\"_blank\" rel=\"noopener\">sitemap<\/a> only contains the correct URLs for its platform.<\/li>\n<p><\/p>\n<li>Use 301 redirects for old URLs when <a href=\"https:\/\/support.hostinger.com\/en\/articles\/4455931-how-to-migrate-a-website-to-hostinger\" target=\"_blank\" rel=\"noopener\">migrating<\/a> content to avoid losing search equity.<\/li>\n<p>\n<\/ul>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Theme_and_Styling_Mismatches\"><\/span>Theme and Styling Mismatches<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>When embedding OpenCart within a WordPress theme (for example using <a href=\"https:\/\/www.hostinger.com\/tutorials\/what-is-iframe\/\" target=\"_blank\" rel=\"noopener\">iframes<\/a>, templates, or integrated headers), <a href=\"https:\/\/www.hostinger.com\/tutorials\/what-is-css\" target=\"_blank\" rel=\"noopener\">css<\/a> and JavaScript can conflict. Font stacks, global CSS selectors, and JavaScript libraries (two different versions of jQuery) can break layout or behavior in either system.<\/p>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Practical_fixes\"><\/span>Practical fixes<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<ul><\/p>\n<li>Keep OpenCart isolated: avoid loading WordPress theme CSS on OpenCart pages and vice versa. If you must share header\/footer, strip theme CSS down or use scoped CSS in OpenCart templates.<\/li>\n<p><\/p>\n<li>Use namespaced selectors in custom CSS to reduce collisions; put OpenCart styles under a wrapper class like .opencart-wrapper and scope rules.<\/li>\n<p><\/p>\n<li>Where library conflicts exist, load only one library version and adapt plugins to that version, or use noConflict() to avoid jQuery collisions.<\/li>\n<p>\n<\/ul>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"PHP_Version_Extensions_and_Compatibility_Errors\"><\/span>PHP Version, Extensions and Compatibility Errors<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>Older OpenCart releases depend on PHP functions or extensions that newer PHP versions deprecate or remove. Errors like \u201cundefined function\u201d or fatal errors after a PHP upgrade are common. WordPress plugins or core also impose PHP requirements, so <a href=\"https:\/\/hostadvice.com\/\" target=\"_blank\" rel=\"noopener\">hosting<\/a> must satisfy both platforms.<\/p>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_to_resolve_compatibility_problems\"><\/span>How to resolve compatibility problems<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<ul><\/p>\n<li>Check OpenCart and WordPress version requirements and upgrade to supported releases. For OpenCart, use the latest stable release where possible because it will have compatibility fixes for modern PHP (7.x\/8.x).<\/li>\n<p><\/p>\n<li>Install required PHP extensions: commonly needed items include <a href=\"https:\/\/www.hostinger.com\/tutorials\/curl-command-with-examples-linux\/\" target=\"_blank\" rel=\"noopener\">curl<\/a>, mbstring, zip, gd or imagick. Use php -m or a <a href=\"https:\/\/www.a2hosting.com\/kb\/developer-corner\/php\/view-php-settings\/\" target=\"_blank\" rel=\"noopener\">phpinfo<\/a>() file to confirm.<\/li>\n<p><\/p>\n<li>If you cannot upgrade immediately, search the community for patches that backport PHP 8 fixes to older OpenCart installations, and test in a staging environment before applying to production.<\/li>\n<p>\n<\/ul>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"File_Permissions_Upload_Errors_and_Image_Paths\"><\/span>File Permissions, Upload Errors and Image Paths<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>OpenCart needs correct file and folder permissions for image uploads, cache writes, and log files. When <a href=\"https:\/\/www.a2hosting.com\/\" target=\"_blank\" rel=\"noopener\">hosted<\/a> alongside WordPress, permission policies might differ, causing images not to show or uploads to fail. Broken thumbnails often stem from incorrect base URLs or rewritten image paths when integrating templates.<\/p>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Permission_and_path_fixes\"><\/span>Permission and path fixes<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<ul><\/p>\n<li>Set directories to 755 and files to 644, and ensure the webserver user (www-data, <a href=\"https:\/\/www.hostinger.com\/tutorials\/what-is-apache\" target=\"_blank\" rel=\"noopener\">apache<\/a>, <a href=\"https:\/\/www.a2hosting.com\/kb\/developer-corner\/nginx-web-server\/installing-the-nginx-web-server\/\" target=\"_blank\" rel=\"noopener\">nginx<\/a>) owns writable folders like image\/cache, system\/storage\/logs, and system\/storage\/cache.<\/li>\n<p><\/p>\n<li>Verify image base URLs in OpenCart\u2019s settings and fix any hard-coded HTTP paths after migrating to HTTPS or moving folders.<\/li>\n<p><\/p>\n<li>Regenerate thumbnails from the admin area if image paths change due to <a href=\"https:\/\/infinitydomainhosting.com\/index.php?rp=\/knowledgebase\/208\/How-to-migrate-your-website-to-a-new-hosting-provider.html\">migration<\/a> or theme updates.<\/li>\n<p>\n<\/ul>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"ajax_cors_and_API_Problems\"><\/span><a href=\"https:\/\/www.hostinger.com\/tutorials\/what-is-ajax\" target=\"_blank\" rel=\"noopener\">ajax<\/a>, <a href=\"https:\/\/support.hostinger.com\/en\/articles\/6320787-is-cors-supported-at-hostinger\" target=\"_blank\" rel=\"noopener\">cors<\/a> and API Problems<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>OpenCart uses AJAX for cart updates, search suggestions, and some front-end features. If WordPress is served from a different domain or if headers are altered by plugins or security modules, AJAX calls may fail or return 403\/500 errors. Cross-origin requests will be blocked unless the server sends Access-Control-Allow-Origin headers.<\/p>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Fixes-2\"><\/span>Fixes<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<ul><\/p>\n<li>If OpenCart is on a subdomain, add CORS headers on the OpenCart server: Access-Control-Allow-Origin:  (be specific; avoid * for authenticated requests).<\/li>\n<p><\/p>\n<li>Check server security modules like mod_security or <a href=\"https:\/\/hostadvice.com\/\" target=\"_blank\" rel=\"noopener\">hosting<\/a> WAF; if they block requests, create exceptions for legitimate AJAX endpoints.<\/li>\n<p><\/p>\n<li>Review console logs (Network tab) to find failing endpoints and return the exact server error. Adjust headers or rewrite rules accordingly.<\/li>\n<p>\n<\/ul>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Practical_Integration_Patterns_to_Avoid_Problems\"><\/span>Practical Integration Patterns to Avoid Problems<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>Some patterns make life simpler: keep OpenCart in a subdomain (store.example.com) or a <a href=\"https:\/\/www.a2hosting.com\/dedicated-server-hosting\/\" target=\"_blank\" rel=\"noopener\">dedicated<\/a> subdirectory (example.com\/shop) and use clean .htaccess rules and consistent SSL settings. Communicate cookie domains between both apps if you need shared sign-on. Use REST APIs or middleware for deep integrations rather than embedding one platform\u2019s templates inside the other. This separation reduces interference with permalinks, caching, and security rules, and makes debugging straightforward.<\/p>\n<p><!--KB_CAT_BLOCK--><\/p>\n<figure class=\"kb-cat-placeholder\" style=\"margin:1.75rem 0;display:block;\">\n<div class=\"kb-cat-wrap\" style=\"position:relative; overflow:hidden; border-radius:12px; box-shadow:0 10px 36px rgba(0,0,0,0.14);\"><img src=\"https:\/\/infinitydomainhosting.com\/kb\/assets\/img\/cat-default.webp\" alt=\"Common Opencart Issues in WordPress and Fixes\" loading=\"lazy\" decoding=\"async\" style=\"max-width:100%;height:auto;display:block;border-radius:12px;box-shadow:0 8px 28px rgba(0,0,0,0.12);\" \/><\/p>\n<div class=\"kb-cat-gradient\" style=\"position:absolute; inset:0; background:linear-gradient(180deg, rgba(9,23,60,0.66) 0%, rgba(11,30,70,0.45) 40%, rgba(11,30,70,0.15) 100%);\"><\/div>\n<div class=\"kb-cat-textbox\" style=\"position:absolute; inset:auto 5% 7% 5%; color:#fff; text-align:center; display:flex; flex-direction:column; gap:.4rem; align-items:center; justify-content:flex-end;\">\n<div class=\"kb-cat-title\" style=\"font-weight:800; font-size:clamp(20px,3.6vw,34px); line-height:1.2; letter-spacing:.2px; text-shadow:0 1px 2px rgba(0,0,0,.35);\">Common Opencart Issues in WordPress and Fixes<\/div>\n<div class=\"kb-cat-meta\" style=\"opacity:1; font-weight:600; font-size:clamp(13px,2.6vw,16px); line-height:1.45; text-shadow:0 1px 2px rgba(0,0,0,.28);\">When opencart and wordpress Share a Site: What Usually Goes Wrong Running OpenCart and WordPress together , whether OpenCart is installed in a subfolder, on a subdomain, or being integrated\u2026<\/div>\n<div class=\"kb-cat-desc\" style=\"opacity:1; font-weight:500; font-size:clamp(12px,2.4vw,15px); line-height:1.5; max-width:900px; text-wrap:balance; text-shadow:0 1px 2px rgba(0,0,0,.25);\">AI<\/div>\n<\/div>\n<\/div>\n<\/figure>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Quick_Troubleshooting_Checklist\"><\/span>Quick Troubleshooting Checklist<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<ul><\/p>\n<li>Are permalinks\/rewrites excluding the OpenCart directory? If not, add exclusions.<\/li>\n<p><\/p>\n<li>Is caching bypassed for cart, checkout and account pages? If not, configure cache rules.<\/li>\n<p><\/p>\n<li>Do OpenCart config.php and WordPress site URLs both use the same scheme (https)?<\/li>\n<p><\/p>\n<li>Are sessions persisting and session.save_path writable?<\/li>\n<p><\/p>\n<li>Are PHP version and extensions compatible with both platforms?<\/li>\n<p><\/p>\n<li>Are cookies set to a domain that covers both apps when cross-domain sessions are needed?<\/li>\n<p>\n<\/ul>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p>OpenCart and WordPress can coexist well if you plan the integration with an eye toward isolation and consistent server settings. Many problems stem from rewrite rules, caching policies, session and cookie settings, protocol mismatches, and differences in PHP requirements. The fastest wins are exclusion rules in .htaccess, disabling cache on dynamic OpenCart endpoints, ensuring SSL settings match in both platforms, and keeping file permissions correct. When in doubt, separate the store (subdomain or subfolder) and use APIs to tie content together so each platform handles what it does best without stepping on the other\u2019s configuration.<\/p>\n<p><\/p>\n<h2><span class=\"ez-toc-section\" id=\"FAQs\"><\/span>FAQs<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"1_Can_I_run_OpenCart_and_WordPress_on_the_same_domain_without_conflicts\"><\/span>1. Can I run OpenCart and WordPress on the same domain without conflicts?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Yes. The safest approach is to place OpenCart in a subfolder (example.com\/shop) or a subdomain (shop.example.com) and configure WordPress rewrite rules and caching to exclude that path. Ensure cookie domains and SSL settings are consistent to avoid session and mixed content issues.<\/p>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"2_Why_does_my_cart_empty_when_I_enable_a_WordPress_caching_plugin\"><\/span>2. Why does my cart empty when I enable a WordPress caching plugin?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Full-page caching can serve static HTML that doesn\u2019t include dynamic cart content, or it can bypass session handling. Exclude cart, checkout, and account URLs from caching, and use AJAX or fragments for cart mini-widgets when necessary.<\/p>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"3_I_upgraded_PHP_and_OpenCart_broke_What_should_I_do\"><\/span>3. I upgraded PHP and OpenCart broke. What should I do?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Check the OpenCart version against PHP compatibility notes. Install required extensions, enable error logs, and consider upgrading OpenCart to a version that supports your PHP release. If upgrading is not possible immediately, search for community patches or run a compatible PHP version per site using a <a href=\"https:\/\/infinitydomainhosting.com\/kb\/how-to-use-cpanel-or-other-control-panel\/\">control panel<\/a> feature or .htaccess directive if your <a href=\"https:\/\/www.a2hosting.com\/\" target=\"_blank\" rel=\"noopener\">host<\/a> supports it.<\/p>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"4_How_do_I_avoid_duplicate_content_between_WordPress_and_OpenCart\"><\/span>4. How do I avoid duplicate content between WordPress and OpenCart?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Decide which platform should serve product pages and mark the other pages as non-indexable or remove duplicated product descriptions. Implement canonical tags on product pages, combine sitemaps carefully, and use 301 redirects for <a href=\"https:\/\/support.hostinger.com\/en\/articles\/4455931-how-to-migrate-a-website-to-hostinger\" target=\"_blank\" rel=\"noopener\">migrated<\/a> content.<\/p>\n<p><\/p>\n<h3><span class=\"ez-toc-section\" id=\"5_Can_I_share_login_or_cart_state_between_WordPress_and_OpenCart\"><\/span>5. Can I share login or cart state between WordPress and OpenCart?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Sharing state is possible but requires careful configuration: consistent cookie domain\/path, identical session settings, and often custom development or middleware. Using a single sign-on (SSO) plugin or an API-based synchronization approach is more robust than trying to share <a href=\"https:\/\/www.a2hosting.com\/kb\/developer-corner\/php\/using-php-sessions\/\" target=\"_blank\" rel=\"noopener\">php sessions<\/a> directly.<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When opencart and wordpress Share a Site: What Usually Goes Wrong Running OpenCart and WordPress together , whether OpenCart is installed in&hellip;<\/p>\n","protected":false},"author":1,"featured_media":51443,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":"","_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[2,9405,4593,9,1,4594,3,5,10,4,11,7,88,8],"tags":[11878,12084,11493,12082,811,10963,16,3820,10989,10432,1032,11147,790,4298,10425,10960,579,73,12083,1826,12085,22],"class_list":["post-51442","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","category-ai","category-databases","category-domains","category-general","category-networking","category-php-scripts","category-seo","category-servers","category-ssl-certificates","category-support","category-web-design","category-web-hosting","category-website-security","tag-bug-fixes","tag-cart-errors","tag-checkout-issues","tag-common-opencart-issues-in-wordpress-and-fixes","tag-configuration","tag-database-errors","tag-ecommerce","tag-extensions","tag-installation","tag-integration","tag-migration","tag-modules","tag-opencart","tag-payment-gateways","tag-performance-optimization","tag-plugin-conflicts","tag-security","tag-seo","tag-theme-compatibility","tag-troubleshooting","tag-updates","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/posts\/51442","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/comments?post=51442"}],"version-history":[{"count":1,"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/posts\/51442\/revisions"}],"predecessor-version":[{"id":51444,"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/posts\/51442\/revisions\/51444"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/media\/51443"}],"wp:attachment":[{"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/media?parent=51442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/categories?post=51442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infinitydomainhosting.com\/kb\/wp-json\/wp\/v2\/tags?post=51442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}