The Best 25 E-Commerce Websites with Amazing Designs for 2024
If you are selling online, a website is a virtual product. In this case, all …
28/04/2023 -
7 dk okuma
Stay up to date with Peakers
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.
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.
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.
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:
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:
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.
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.
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.
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.
Get an Offer
Join Us So You Don't
Miss Out on Digital Marketing News!
Join the Digipeak Newsletter.
Related Posts
If you are selling online, a website is a virtual product. In this case, all …
The loading speed of websites is one of the essential factors to improve the user …
Chrome is used by the vast majority of people, and it makes sense to think …
There may be certain situations where the person who will design the website needs to …