window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/svg\/","svgExt":".svg","source":{"concatemoji":"https:\/\/archondigital.com\/wp-includes\/js\/wp-emoji-release.min.js?ver=6.1.1"}};
/*! This file is auto-generated */
!function(e,a,t){var n,r,o,i=a.createElement("canvas"),p=i.getContext&&i.getContext("2d");function s(e,t){var a=String.fromCharCode,e=(p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,e),0,0),i.toDataURL());return p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,t),0,0),e===i.toDataURL()}function c(e){var t=a.createElement("script");t.src=e,t.defer=t.type="text/javascript",a.getElementsByTagName("head")[0].appendChild(t)}for(o=Array("flag","emoji"),t.supports={everything:!0,everythingExceptFlag:!0},r=0;r<o.length;r++)t.supports[o[r]]=function(e){if(p&&p.fillText)switch(p.textBaseline="top",p.font="600 32px Arial",e){case"flag":return s([127987,65039,8205,9895,65039],[127987,65039,8203,9895,65039])?!1:!s([55356,56826,55356,56819],[55356,56826,8203,55356,56819])&&!s([55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447],[55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447]);case"emoji":return!s([129777,127995,8205,129778,127999],[129777,127995,8203,129778,127999])}return!1}(o[r]),t.supports.everything=t.supports.everything&&t.supports[o[r]],"flag"!==o[r]&&(t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&t.supports[o[r]]);t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&!t.supports.flag,t.DOMReady=!1,t.readyCallback=function(){t.DOMReady=!0},t.supports.everything||(n=function(){t.readyCallback()},a.addEventListener?(a.addEventListener("DOMContentLoaded",n,!1),e.addEventListener("load",n,!1)):(e.attachEvent("onload",n),a.attachEvent("onreadystatechange",function(){"complete"===a.readyState&&t.readyCallback()})),(e=t.source||{}).concatemoji?c(e.concatemoji):e.wpemoji&&e.twemoji&&(c(e.twemoji),c(e.wpemoji)))}(window,document,window._wpemojiSettings);
var breeze_prefetch = {"local_url":"https:\/\/archondigital.com","ignore_remote_prefetch":"1","ignore_list":["\/wp-admin\/"]};
https://archondigital.com/wp-content/plugins/breeze/assets/js/js-front-end/breeze-prefetch-links.min.js
https://archondigital.com/wp-includes/js/jquery/jquery.min.js
WebFont.load({
classes: false,
loading: function() {
document.documentElement.style.opacity = 0
},
active: function() {
document.documentElement.removeAttribute("style")
},
custom: {
families: ["Cardo:700,italic,regular","Libre Franklin:100,100italic,200,200italic,300,300italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic,italic,regular"],
urls: ["https://fonts.googleapis.com/css?family=Cardo:700,italic,regular&display=swap","https://fonts.googleapis.com/css?family=Libre Franklin:100,100italic,200,200italic,300,300italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic,italic,regular&display=swap"]
}
})
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());gtag('config', 'UA-431457-5');
Skip to main content Skip to footer Permalink Migration on WordPress
Update: This is an old archived post on this site and is only kept online for my own archival purposes. The content and images on this post this might be outdated and incomplete. Please do not sue me if the Internet breaks because you read this.
It has been one of those things you knew you had to do but was near the bottom of your very long to-do list. But after a few days of thinking it over and browsing the web and eventually looking for the right plugins, I managed to migrate my permalink structure to a more keyword rich, SEO friendly layout.
My old permalink structure was the date based /%year%/%monthnum%/%day%/%postname%/ which I still find to be useful for proper chronological organization of one’s journal or news items but I also find my new permalink structure /%category%/%postname%/ to be more keyword rich and easier for both humans and bots.
The PluginI am now using Permalink Redirect by Scott Yang to help me simplify the process of migrating permalinks. The plugin worked like a charm. I tested how the plugin would handle backlinks using the old permalink structure and everything redirected properly to the new permalink structure without any noticeable delay.
Small HiccupThere was only one problem I encountered while migrating my permalink structure and that was which category name will be used. By default, WordPress would use the category name with the lowest ID if incase you have multiple categories per post. My theme makes use of different categories as well as some temporary categories which I use as a switch to place posts on the four special feature sections of my theme.
The answer to this minor problem was sCategory Permalink , a plugin by Dmytro Shteflyuk which allows you to tick which category your post will use for your permalink structure. It works by making use of a custom permalink option %scategory% (take note of the extra “s” before the category word).
There is Always a Better WayWhat I really wanted was to somehow write a few lines of code on my vhost file on Nginx so redirection would be done on the webserver and not through PHP. For me this is the ideal setup as it puts less load on your server. I also have enough documentation to configure this for Apache but not for Nginx. The next few days were spent looking around for answers, which included several forum postings and reading a lot of Nginx documentation. I gave up after a week so I was left with the plugin option instead but still open to learning how to do it through Nginx but for now I would settle for the plugin.
A person’s quest for knowledge can only be limited by himself and not by anything else. For now this setup works well for me but I know there is better way of doing things.
Other Related ArticlesMigrating your WordPress Permalinks Structure by Michael Aulia
Like this: Like Loading...
animateElements();const ASCII_OF_A = "a".charCodeAt();
const NO_OF_ALPHABETS = 26;function animateElement(element, originalText, options) {
let iteration = 0;if (options.interval) {
return;
}options.interval = setInterval(() => {
const newWord = originalText
.split("")
.map((_, idx) => {
if (idx < iteration) {
return originalText[idx];
}
return String.fromCharCode(
Math.trunc(Math.random() * NO_OF_ALPHABETS) + ASCII_OF_A
);
})
.join("");
element.innerText = newWord;iteration += 1;if (iteration > originalText.length) {
clearInterval(options.interval);
options.interval = null;
}
}, 30);
}function getRandomLetter() {}function animateElements() {
const elements = document.getElementsByClassName("animate-terminal");for (const element of elements) {
const originalText = element.innerText;
const options = {
interval: null
};
animateElement(element, originalText, options);element.addEventListener("mouseover", (event) => {
animateElement(event.target, originalText, options);
});
}
}
window.WPCOM_sharing_counts = {"https:\/\/archondigital.com\/articles\/permalink-migration-142\/":1558};
https://archondigital.com/wp-content/plugins/jetpack/_inc/build/photon/photon.min.js
var dlmXHRtranslations = {"error":"An error occurred while trying to download the file. Please try again."};
const dlmXHR = {"xhr_links":{"class":["download-link","download-button"]},"prevent_duplicates":true,"ajaxUrl":"https:\/\/archondigital.com\/wp-admin\/admin-ajax.php","nonce":"35c9df6d9e"}; dlmXHRinstance = {}; const dlmXHRGlobalLinks = "https://archondigital.com/download/"; dlmXHRgif = "https://archondigital.com/wp-includes/images/spinner.gif"
https://archondigital.com/wp-content/plugins/download-monitor/assets/js/dlm-xhr.min.js
https://archondigital.com/wp-content/plugins/jetpack/_inc/build/likes/queuehandler.min.js
https://archondigital.com/wp-includes/js/comment-reply.min.js
https://archondigital.com/wp-content/plugins/akismet/_inc/akismet-frontend.js
var sharing_js_options = {"lang":"en","counts":"1","is_stats_active":"1"};
https://archondigital.com/wp-content/plugins/jetpack/_inc/build/sharedaddy/sharing.min.js
var windowOpen;
( function () {
function matches( el, sel ) {
return !! (
el.matches && el.matches( sel ) ||
el.msMatchesSelector && el.msMatchesSelector( sel )
);
}document.body.addEventListener( 'click', function ( event ) {
if ( ! event.target ) {
return;
}var el;
if ( matches( event.target, 'a.share-facebook' ) ) {
el = event.target;
} else if ( event.target.parentNode && matches( event.target.parentNode, 'a.share-facebook' ) ) {
el = event.target.parentNode;
}if ( el ) {
event.preventDefault();// If there's another sharing window open, close it.
if ( typeof windowOpen !== 'undefined' ) {
windowOpen.close();
}
windowOpen = window.open( el.getAttribute( 'href' ), 'wpcomfacebook', 'menubar=1,resizable=1,width=600,height=400' );
return false;
}
} );
} )();
var windowOpen;
( function () {
function matches( el, sel ) {
return !! (
el.matches && el.matches( sel ) ||
el.msMatchesSelector && el.msMatchesSelector( sel )
);
}document.body.addEventListener( 'click', function ( event ) {
if ( ! event.target ) {
return;
}var el;
if ( matches( event.target, 'a.share-twitter' ) ) {
el = event.target;
} else if ( event.target.parentNode && matches( event.target.parentNode, 'a.share-twitter' ) ) {
el = event.target.parentNode;
}if ( el ) {
event.preventDefault();// If there's another sharing window open, close it.
if ( typeof windowOpen !== 'undefined' ) {
windowOpen.close();
}
windowOpen = window.open( el.getAttribute( 'href' ), 'wpcomtwitter', 'menubar=1,resizable=1,width=600,height=350' );
return false;
}
} );
} )();
var windowOpen;
( function () {
function matches( el, sel ) {
return !! (
el.matches && el.matches( sel ) ||
el.msMatchesSelector && el.msMatchesSelector( sel )
);
}document.body.addEventListener( 'click', function ( event ) {
if ( ! event.target ) {
return;
}var el;
if ( matches( event.target, 'a.share-linkedin' ) ) {
el = event.target;
} else if ( event.target.parentNode && matches( event.target.parentNode, 'a.share-linkedin' ) ) {
el = event.target.parentNode;
}if ( el ) {
event.preventDefault();// If there's another sharing window open, close it.
if ( typeof windowOpen !== 'undefined' ) {
windowOpen.close();
}
windowOpen = window.open( el.getAttribute( 'href' ), 'wpcomlinkedin', 'menubar=1,resizable=1,width=580,height=450' );
return false;
}
} );
} )();
var windowOpen;
( function () {
function matches( el, sel ) {
return !! (
el.matches && el.matches( sel ) ||
el.msMatchesSelector && el.msMatchesSelector( sel )
);
}document.body.addEventListener( 'click', function ( event ) {
if ( ! event.target ) {
return;
}var el;
if ( matches( event.target, 'a.share-tumblr' ) ) {
el = event.target;
} else if ( event.target.parentNode && matches( event.target.parentNode, 'a.share-tumblr' ) ) {
el = event.target.parentNode;
}if ( el ) {
event.preventDefault();// If there's another sharing window open, close it.
if ( typeof windowOpen !== 'undefined' ) {
windowOpen.close();
}
windowOpen = window.open( el.getAttribute( 'href' ), 'wpcomtumblr', 'menubar=1,resizable=1,width=450,height=450' );
return false;
}
} );
} )();
(function () {
var comm_par_el = document.getElementById( 'comment_parent' ),
comm_par = ( comm_par_el && comm_par_el.value ) ? comm_par_el.value : '',
frame = document.getElementById( 'jetpack_remote_comment' ),
tellFrameNewParent;tellFrameNewParent = function () {
if ( comm_par ) {
frame.src = "https://jetpack.wordpress.com/jetpack-comment/?blogid=112850028&postid=1558&comment_registration=0&require_name_email=1&stc_enabled=1&stb_enabled=1&show_avatars=1&avatar_default=mystery&greeting=Leave+a+Reply&jetpack_comments_nonce=46c75929a1&greeting_reply=Leave+a+Reply+to+%25s&color_scheme=light&lang=en_US&jetpack_version=11.7.1&show_cookie_consent=0&has_cookie_consent=0&token_key=%3Bnormal%3B&sig=760430fcf2092abca49936aed6e5dcdc0b126beb#parent=https%3A%2F%2Farchondigital.com%2Farticles%2Fpermalink-migration-142%2F" + '&replytocom=' + parseInt( comm_par, 10 ).toString();
} else {
frame.src = "https://jetpack.wordpress.com/jetpack-comment/?blogid=112850028&postid=1558&comment_registration=0&require_name_email=1&stc_enabled=1&stb_enabled=1&show_avatars=1&avatar_default=mystery&greeting=Leave+a+Reply&jetpack_comments_nonce=46c75929a1&greeting_reply=Leave+a+Reply+to+%25s&color_scheme=light&lang=en_US&jetpack_version=11.7.1&show_cookie_consent=0&has_cookie_consent=0&token_key=%3Bnormal%3B&sig=760430fcf2092abca49936aed6e5dcdc0b126beb#parent=https%3A%2F%2Farchondigital.com%2Farticles%2Fpermalink-migration-142%2F";
}
};
if ( 'undefined' !== typeof addComment ) {
addComment._Jetpack_moveForm = addComment.moveForm;addComment.moveForm = function ( commId, parentId, respondId, postId ) {
var returnValue = addComment._Jetpack_moveForm( commId, parentId, respondId, postId ),
cancelClick, cancel;if ( false === returnValue ) {
cancel = document.getElementById( 'cancel-comment-reply-link' );
cancelClick = cancel.onclick;
cancel.onclick = function () {
var cancelReturn = cancelClick.call( this );
if ( false !== cancelReturn ) {
return cancelReturn;
}if ( ! comm_par ) {
return cancelReturn;
}comm_par = 0;tellFrameNewParent();return cancelReturn;
};
}if ( comm_par == parentId ) {
return returnValue;
}comm_par = parentId;tellFrameNewParent();return returnValue;
};
}
// Do the post message bit after the dom has loaded.
document.addEventListener( 'DOMContentLoaded', function () {
var iframe_url = "https:\/\/jetpack.wordpress.com";
if ( window.postMessage ) {
if ( document.addEventListener ) {
window.addEventListener( 'message', function ( event ) {
var origin = event.origin.replace( /^http:\/\//i, 'https://' );
if ( iframe_url.replace( /^http:\/\//i, 'https://' ) !== origin ) {
return;
}
frame.style.height = event.data + 'px';
});
} else if ( document.attachEvent ) {
window.attachEvent( 'message', function ( event ) {
var origin = event.origin.replace( /^http:\/\//i, 'https://' );
if ( iframe_url.replace( /^http:\/\//i, 'https://' ) !== origin ) {
return;
}
frame.style.height = event.data + 'px';
});
}
}
})})();
_stq = window._stq || [];
_stq.push([ 'view', {v:'ext',blog:'112850028',post:'1558',tz:'8',srv:'archondigital.com',j:'1:11.7.1'} ]);
_stq.push([ 'clickTrackerInit', '112850028', '1558' ]);