
{"id":87,"date":"2022-02-02T07:13:00","date_gmt":"2022-02-02T04:13:00","guid":{"rendered":"http:\/\/blog.travelpayouts.com\/en\/?p=87"},"modified":"2023-12-01T12:41:43","modified_gmt":"2023-12-01T09:41:43","slug":"replace-links-bulk-wordpress","status":"publish","type":"post","link":"https:\/\/www.travelpayouts.com\/blog\/replace-links-bulk-wordpress\/","title":{"rendered":"How to Bulk Replace Links in WordPress?"},"content":{"rendered":"\n<p>Webmasters don\u2019t like to concern themselves with routine work, in particular the one giving no immediate satisfaction. No doubt, bulk change of links on the website is one of them: though it is done not so often, only some of them are satisfied with the prospect of killing their time on the change of hundreds of URLs by hand.<\/p>\n\n\n\n<p>However, if you really have to do it (when moving to a new domain, or, for example, you want to replace the existing links with Travelpayouts URLs), don\u2019t worry. Feel free to turn this task over to a soulless machine. How? Read our selection of TOP 3 most convenient ways to do it!!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">#1: MySQL Query<\/h2>\n\n\n\n<p>This is the easiest and universal recipe for a quick change of all links on your website involving a direct work with MySQL database (unless you use this system).<\/p>\n\n\n\n<p>Your actions are as follows. First, sign in to phpmyadmin, find your database there containing \u201cwp_posts\u201d table (if you are using WordPress) with the \u201cX\u201d field storing the URLs. Then, you should open the SQL tab and execute the following query:<\/p>\n\n\n\n<p>UPDATE wp_posts SET \u0425= REPLACE (\u0425, \u201can old link\u201d, \u201ca new link\u201d)<\/p>\n\n\n\n<p>Now you have just to click \u201cGo\u201d (or a corresponding icon, if your interface differs). It\u2019s a done deal!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">#2: PHP Script Upload to the Website<\/h2>\n\n\n\n<p>Bulk link change is a well-known issue. No wonder that ready-made solutions have been already provided: <a href=\"https:\/\/interconnectit.com\/products\/search-and-replace-for-wordpress-databases\/\" target=\"_blank\" rel=\"noopener\">Search and Replace script<\/a> by the Interconnect Company. Though it has been initially created for WordPress, it is applicable to other popular CMS (such as Drupal or Joomla).<\/p>\n\n\n\n<p>Its use is simple as falling off a log: download zip file using the link above, extract the search-replace-db-master folder (for ver. 3.1.0), rename it if needed and upload via ftp to a public directory of your hosting (but not in the website root, remember it!).<\/p>\n\n\n\n<p>Back up your database (never, never forget to make a backup!) and open the uploaded folder on your server via your browser\u2019s address bar. The script launches automatically, so you will have only to choose the database and links you are going to replace.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">#3: Better Search Replace Plugin for WordPress<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/travelpayouts.com\/blog\/wp-content\/uploads\/2016\/03\/find_and_replace.png\" alt=\"find and replace wordpress\"\/><\/figure>\n\n\n\n<p>Hate to upload other people\u2019s scripts to your website? We know it, so we\u2019ve got an alternative for the owners of WordPress websites. Perhaps, this CMS has the most convenient plugin for bulk link change \u2013 Better Search Replace. It is easily integrated, compatible with any hosting (according to its developers), and seems perfect for work with WordPress Multisite.<\/p>\n\n\n\n<p>Everything is quite simple. For example, when moving your site you\u2019ll have to do the following: firstly, it is necessary to integrate the plugin and make a backup of the database (obligatory!), as well as to install the database and engine on a new hosting. Then you should specify a new URL in wp-config.php (learn more about it <a href=\"https:\/\/codex.wordpress.org\/Changing_The_Site_URL#Edit_wp-config.php\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>), log in to the admin panel of the new website and launch Better Search Replace to replace old URLs with new ones.<\/p>\n\n\n\n<p>And it\u2019s almost fixed \u2013 now you have just to remove the changed parameter site_url from wp-config.php and generate a new .htaccess file (via Settings-Permalinks in WordPress admin panel) if needed. And don\u2019t forget to back up your database each time you work with it, unless possible errors caused by plugin customization can kill your website!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">#4: LinkSwitcher by Travelpayouts<\/h2>\n\n\n\n<p>If you decide to monetize your travel website and need to turn your existing links into affiliate links, take advantage of the Travelpayouts LinkSwitcher. Simply add this script to your website and all your links to the websites of Travelpayouts brands will automatically turn into affiliate links. <\/p>\n\n\n\n<p>As a result, all clicks and reservations will be taken into account and a commission will be charged to you. In our <a href=\"https:\/\/support.travelpayouts.com\/hc\/en-us\/articles\/13364284090002\">Help Center<\/a>, you can find step-by-step instructions on how to run the script. To start using the script, you need to be registered at the Travelpayouts partnership platform first.\u00a0<\/p>\n\n\n\n<p>If you don\u2019t have an account yet, <a href=\"https:\/\/www.travelpayouts.com\/en\/\">sign up<\/a> at the link below to gain access to simple, native, helpful tools, including LinkSwitcher. After registering on the Travelpayouts platform, you will be able to earn via <a href=\"https:\/\/www.travelpayouts.com\/blog\/best-affiliate-programs-for-travel-sites\/\">travel affiliate programs<\/a> by working with over 100 well-known brands, such as Booking.com, TripAdvisor, Kiwi.com, and more.<\/p>\n\n\n<div class=\"cta-shortcode cta-block-register --blue  \">\n    <div class=\"cta-block-register__image --right\"><\/div> \n    \n    <div class=\"cta-block-register__content\">\n        <div class=\"cta-block-register__content-wrap\">\n            <h5 class=\"cta-block-register__title tpe-title-m\">\n                Join the Travelpayouts partnership platform\n            <\/h5>\n\n            \n\n            <a class=\"cta-block-register__link tpe-btn-default tpe-btn cta-shortcode__btn\" href=\"https:\/\/www.travelpayouts.com\/\" target=\"_blank\" sp-signup>\n                Join today\n            <\/a>\n        <\/div>\n\n                    <div class=\"tag --a\">\n                <span><i>Powerful<\/i> AI tools for grow<\/span>\n            <\/div>\n                    <div class=\"tag --b\">\n                <span><i>600k<\/i> partners already trust us<\/span>\n            <\/div>\n                    <div class=\"tag --c\">\n                <span><i>90+<\/i> travel<br>brands<\/span>\n            <\/div>\n            <\/div>\n    \n    \n    \n<\/div>\n\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>However, if you still doubt about your abilities and skills, you\u2019d better find a specialist. This will help you avoid possible problems with your website, thus preserving your time, money and efforts.<\/p>\n\n\n\n<p>P.S. We\u2019ve got great news for those using <a href=\"https:\/\/wordpress.org\/plugins\/travelpayouts\/\" target=\"_blank\" rel=\"noopener noreferrer\">our plugin for WordPress:<\/a> we are planning to enrich its basic functionality with one more function \u2013 bulk link change. The work &#8230; is in full swing!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Need to replace many links on your website at once? Don\u2019t worry, this routine task can be automated. Here you will learn how to do it quickly and easily.\u00a0<\/p>\n","protected":false},"author":3,"featured_media":12146,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_eb_attr":"","footnotes":""},"categories":[7],"tags":[77,55],"class_list":["post-87","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-advices","tag-links","tag-wordpress"],"acf":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.travelpayouts.com\/blog\/wp-json\/wp\/v2\/posts\/87","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.travelpayouts.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.travelpayouts.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.travelpayouts.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.travelpayouts.com\/blog\/wp-json\/wp\/v2\/comments?post=87"}],"version-history":[{"count":18,"href":"https:\/\/www.travelpayouts.com\/blog\/wp-json\/wp\/v2\/posts\/87\/revisions"}],"predecessor-version":[{"id":22633,"href":"https:\/\/www.travelpayouts.com\/blog\/wp-json\/wp\/v2\/posts\/87\/revisions\/22633"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.travelpayouts.com\/blog\/wp-json\/wp\/v2\/media\/12146"}],"wp:attachment":[{"href":"https:\/\/www.travelpayouts.com\/blog\/wp-json\/wp\/v2\/media?parent=87"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.travelpayouts.com\/blog\/wp-json\/wp\/v2\/categories?post=87"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.travelpayouts.com\/blog\/wp-json\/wp\/v2\/tags?post=87"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}