➤ WP Internal Linking Guide: Changing Internal Links in WordPress
Enes karadağ

Enes karadağ

04.28.2023
04.28.2023

WP Internal Linking Guide: Changing Internal Links in WordPress

Table Of Content

If you have a website built on WordPress and you have changed some of the links in your content, you will also need to change the old WordPress links to the new ones on other pages where the link appears. With a few quick wins that I will explain to you, instead of going through each page one by one to change the links, you will be able to easily replace the old WordPress links with the new ones on all your pages from a single point. This way, you will successfully complete your WordPress page internal linking process. Before we begin, I would like to briefly talk about internal linking.

What Is Internal Linking? Why Is It Important?

Internal linking is the process of placing links between pages on a website. This can be interpreted as a specific word or sentence (also known as Anchor Text or WordPress Anchor Links) on one page linking to another page. Internal linking is important both for improving user experience and for Search Engine Optimization (SEO).

Some reasons for the importance of internal linking can be listed as follows:

In conclusion, internal linking improves user experience and enhances SEO performance by creating links between pages on a website. A well-structured internal linking strategy contributes to providing a better experience for users and helps pages be noticed and scanned more easily by search engine bots.

How to Change WordPress Internal Links in Bulk?

There are two different methods for this approach. One is to use a WordPress plugin, and the other is to write a WordPress code where you have more control. While using a plugin may seem like a more practical solution, you may encounter odd results in some cases. To give a small example of these situations;

Let’s say you want to change the digipeak.org/old-link/ page to digipeak.org/new-link/ and you update all URLs with /old-link/ in the pages to /new-link/ using a plugin.

The problem you will face here will come to light in cases where you use /old-link/ as a parent slug on your website (digipeak.org/old-link/version-1). The digipeak.org/old-link/version-1 address has now changed to digipeak.org/new-link/version-1, and your WordPress links with parent slug no longer work.

To prevent this, we will prepare a function that will only allow URLs to be changed when they have a one-to-one match. Let’s start with the practical method first.

Changing Links on WordPress Pages with a Plugin

Manually changing internal links one by one on your WordPress site is tedious and impractical. Instead, you can use the Go Live Update Urls plugin. Let’s explain how to use this popular WordPress plugin.

Since the data is stored in the database in WordPress sites, the links within your page are also stored in the database. With this handy plugin, you can specify which table in your database you want to make changes to. The installation and usage steps are as follows:

Step 1: Installation

After logging in to the WordPress admin panel, click on the “Plugins” menu on the left and then click “Add New”. Search for “Go Live Update Urls” in the search bar, download and activate the plugin developed by OnPoint Plugins.

The plugin looks like:

Step 2: Updating Links

You can start changing your WordPress page links quickly without the need for any additional settings during the installation phase. A menu is not directly added to the panel for accessing the plugin interface, instead, a menu called “Go Live” appears under the Tools section. When you click on this menu, you will be greeted with the window below:

All you need to do on this screen is to specify which table you want to update and place both the old and new URLs in the boxes below. When you click on the “Update Urls” button below, your links will be updated in all tables you have specified.

Changing Internal Links in Pages by Codes

If you need to change the page link in WordPress and want to change all links from a single source, you can use the code I will describe to change all your links at once. To use this method, you can make additions to your theme’s function file or use a plugin to run code snippets.

As many themes can’t detect PHP codes inside the page, this method, which is compatible with most themes, will be much more useful. Once again, we access the Appearance -> Theme File Editor section from the left side of your WordPress admin panel.

In this window, we can see an editor where our theme files can be viewed and edited. On the right hand side, you can see a list of your theme files. Open the function.php file, which is responsible for running all of your website’s functions.

Go to the bottom of the function.php file and add the following code:

function replace_urls_in_content( $content ) {

    $url_mappings = array(

   ”https://digipeak.org/eski-link-0/’ => ‘https://digipeak.org/yeni-link-0’,

‘https://digipeak.org/eski-link/’ => ‘https://digipeak.org/yeni-link’,

   );

    foreach ( $url_mappings as $old_url => $new_url ) {

        $content = str_replace( $old_url, $new_url, $content );

    }

    return $content;

}

In this code, you can add the old-link-0 and new-link-0 fields according to the link you want to change. There is an array in the function to change multiple links simultaneously. By placing hundreds of links in this array, you can replace old links with new ones on all your pages. The code’s brief and understandable structure will also help with customization. By making changes to the code, you can add some rules and activate features like filtering.

In a Nutshell: It’s Very Easy to Give and Change Internal Links in WordPress!

With all this info, a well-structured internal linking strategy not only improves your site’s performance but also helps improve your rankings. You should remember that even if you create perfect content, you may not perform well enough without WordPress anchor links.

A strong internal linking strategy can help both users and search engine bots better understand your website. This can promote organic growth by improving your SEO performance and SERP ranking (Search Engine Result Page).

Therefore, choosing one of the methods mentioned instead of manually changing the internal links on your site can be very beneficial.

Reach the Peak: Embrace the Power of Digital with Digipeak!

Digipeak is a digital marketing agency based in Turkey and the UK, offering SEO, Content Marketing, Google Paid Marketing and other digital marketing services to clients.

As Digipeak, we provide our clients with various digital marketing services, helping our brands reach their target audiences more effectively and gain a competitive advantage in the digital world.

You can visit our blog page to read other articles written by our creative team that will enhance your site’s performance and help you grow; or contact us now for professional support.

Author

Enes karadağ

Enes karadağ

Related Content

Loading...