Updated on Jun 6, 2023
WordPress sliders can be highly beneficial. You can quickly achieve the desired professional look for your WordPress site by using a plugin such as Slider Revolution (aka Revolution Slider or RevSlider). However, RevSlider, like many other plugins, can cause some complications in certain situations. In this post, we will discuss some issues we encountered while changing the WordPress URL of a website with the RevSlider plugin activated. If you encounter this problem, we will show you how to resolve it quickly.
This post includes:
WordPress Sliders are plugins that allow you to display content in a slideshow format on any WordPress site page. There are a plethora of WordPress slider plugins available. They enable you to create your sliders and add them to your WordPress sites' landing pages, home pages, or anywhere else you want.
Sliders can save space on a website by aggregating similar or critical content in one location. They can reduce distractions and keep viewers focused on important content. Sliders that allow visitors to control how the content moves encourage interactivity and enable visitors to view materials at their own pace.
However, sliders have a disadvantage. They can significantly increase page load time, negatively impacting SEO and conversion rates. They may also look different than expected on mobile devices.
This article will focus on how the RevSlider plugin impacts URLs within your website and how that affects URL changes.
URLs for everything on your website are saved in your website's database. All site images, videos, etc., are associated with a URL. You may have seen it in your browser when opening an image. The issue comes from RevSlider saving URLs with escaped backslashes. So, in the database, a URL might look something like this:
Typically, a URL will have only the forward slashes:
That in and of itself is not an issue. Your browser will still open both the slideshow and the images within it with ease, and the functionality of your website will not be harmed. The issue comes when trying to change the URL of your website to something else. For instance:
There are many ways to accomplish that, but the easiest and most straightforward way is to use WordPress' own Command Line Interface (CLI). It comes with an array of commands which allow you to control your website in various ways. One of those ways is to change its URL via this command:
wp search-replace <Old URL> <New URL> --all-tables
The main problem is that the WP-CLI search-replace command will not catch the RevSlider URLs. Thus your URL references will still point to the previous environment.
From production to test, this isn't a big deal. However, if an image, for instance, exists in the test environment but not in production, and the image makes it to production, it won't open in your browser.
Fortunately, someone wrote a WP-CLI package to handle this. By installing it, you will be able to run something like the following:
wp rsr all https://example.com/blog https://example.com/
It should work, but in case it does not, we have a Plan B. There is a manual solution to the issue, which is quite logical. You can use the search-replace command we mentioned above. However, you have to modify it. Example:
wp search-replace "https:\/\/www.example.com\/blog" "https:\/\/www.example.com" --all-tables
In this case, example.com is the name of your website. We included the escaped backslashes because that is how the plugin modifies the website's URLs. By doing so, our search-replace command will find those URLs in the database and replace them accordingly.
These two solutions should be more than enough to resolve this hurdle the RevSlider poses.
If you have stumbled upon this issue and the solutions from above didn't work — don't hesitate to contact us anytime. Please open a support ticket; our technical support team will assist you swiftly.
We hope you find this article useful. Discover more about FastCloud - the top-rated Hosting Solutions for personal and small business websites in four consecutive years by the HostAdvice Community!