Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

Tuesday , April 1 2025
Breaking News

Visualcomposer – error array_search() expects parameter 2 to be array, null given (ContentUrlReplaceController.php)

This error appeared after the transfer of the site to another domain. Due to this error, there is no access to /wp-admin, and this error is displayed on the site above the content:

Warning: array_search() expects parameter 2 to be array, null given in /wp-content/plugins/visualcomposer/visualcomposer/Modules/FrontView/ContentUrlReplaceController.php on line 68

The error in the admin panel:

Warning: array_search() expects parameter 2 to be array, null given in /wp-content/plugins/visualcomposer/visualcomposer/Modules/FrontView/ContentUrlReplaceController.php on line 68

Warning: Cannot modify header information - headers already sent by (output started at /wp-content/plugins/visualcomposer/visualcomposer/Modules/FrontView/ContentUrlReplaceController.php:68) in /wp-includes/pluggable.php on line 1265

Warning: Cannot modify header information - headers already sent by (output started at /wp-content/plugins/visualcomposer/visualcomposer/Modules/FrontView/ContentUrlReplaceController.php:68) in /wp-includes/pluggable.php on line 1268

Solution to fix Visualcomposer issue without disabling the plugin

Edit the file /wp-content/plugins/visualcomposer/visualcomposer/Modules/FrontView/ContentUrlReplaceController.php, find line 68 and comment the following code:

$siteKey = array_search($siteUrl, $siteUrls['prevUrls']);
        if (false !== $siteKey) {
            unset($siteUrls['prevUrls'][ $siteKey ]);
            $optionsHelper->set('siteUrls', ['prevUrls' => $siteUrls['prevUrls'], 'currentUrl' => $siteUrl]);
        }

About iryna

I'm Iryna, a web developer from Ukraine with a decade of experience solving complex technical challenges in the world of freelance. Throughout my career, I've worked on everything from troubleshooting server-side issues and optimizing website performance to enhancing user interfaces. On this blog, I share detailed solutions to the technical problems I’ve encountered and methods that have worked best for me. In addition to my technical expertise, I’m also passionate about digital drawing. I hope the tutorials and insights I provide here will help both fellow developers and creatives alike in their own projects.

Check Also

How to remove 404 //fonts.gstatic.com and //fonts.googleapis.com from WordPress head section

I tried solutions with functions that should remove from head and , but a very …

Leave a Reply

Your email address will not be published. Required fields are marked *