4

I am trying to target all links with no www. in the database.

https://launchhousing.org.au

and replace with

https://www.launchhousing.org.au

I have used the 'search and replace' plugin which has apparently changed all of the links but somehow Visual Composer seems to still have links without the www. I am using the VC 'Icon Box' and added in the URL field: http://launchhousing.org.au/category/policy-agenda/

JoshRicha
  • 311
  • 4
  • 18

2 Answers2

12

Visual Composer store links in urlencode format as:
link=\"url:http%3A%2F%2Fsite.com%2Findex.php%2Fmembership-account%2Fmembership-levels%2F|||\"


That's why you can't find.

You need make sql dump of your database and make replacing:
http%3A%2F%2Foldsite.com%2Fhttp%3A%2F%2Fnewsite.com%2F
I hope this helps. Good luck.

Tegos
  • 405
  • 6
  • 14
  • 1
    To complete this answer, This site [encode-decode](https://www.url-encode-decode.com/) Encodes urls, then with a simple Database Search and Replace plugin like [Search & Replace](https://wordpress.org/plugins/search-and-replace/) you can change any links. – Meisam Aug 04 '18 at 15:29
0

You mean links that are in the page/post content? These will be in the post_content of the wp_posts table, along with the rest of the content. All the VC elements you put into a page/post are just shortcodes.

Though I also have found that plugins, such as WP DB Migrate seem to miss VC stuff in the post_content column.

I always have to manually do an SQL query. You can do this in phpmyadmin:

UPDATE wp_posts SET post_content = REPLACE(post_content, 'launchhousing.org.au', 'www.launchhousing.org.au')

And remember to change 'wp_posts' if your prefix is different.

Dan.
  • 609
  • 1
  • 6
  • 17