How To Fix Duplicate Meta Title for Archive Pages?

Just use Yoast and add %%page%% to the Archive title, and it will add the page number, therefore removing the duplicate title tag issue as nothing will be the same, or

remember to also add %%sep%% so it adds a seperator, so example:

%%term_title%% %%sep%% %%page%% %%sep%% %%sitename%%

would appear as: category name – Page 2 of 50 – domain name

of course, domain name and the final separator are optional.

Changing The Site URL on wp-config file

Edit wp-config.php

Add these two lines to your wp-config.php, where “example.com” is the correct location of your site.


This is not necessarily the best fix, it’s just hardcoding the values into the site itself. You won’t be able to edit them on the General settings page anymore when using this method.

How to remove http://, www and slash from URL in PHP?

$input = 'www.google.co.uk/';

// in case scheme relative URI is passed, e.g., //www.google.com/
$input = trim($input, '/');

// If scheme not included, prepend it
if (!preg_match('#^http(s)?://#', $input)) {
    $input = 'http://' . $input;

$urlParts = parse_url($input);

// remove www
$domain = preg_replace('/^www\./', '', $urlParts['host']);

echo $domain;

// output: google.co.uk