change permalinks as per your choice in wordpress using post_link filter

change permalinks as per your choice in wordpress

WordPress publishing URL you can change to anything using following function. Following wordpress hook is very important. You can publish article with different URL or domain also. Using your blog you can publish your article to another URL also.

change permalinks as per your choice in wordpress

You just need to open your functions.php file and put following function in that file.

<pre><pre>
add_filter('post_link', 'fitsmi_post_link');
function fitsmi_post_link($permalink) {
	global $post;
        $permalink = str_replace("wordpress/", "", $permalink);
        return $permalink;
	if (!isset($post))
		return $permalink;
	else
		return 'http://hack.by.wordpressapi/';
}
change permalinks as per your choice in wordpress using post_link filter
change permalinks as per your choice in wordpress using post_link filter

 

With following function you need to be very careful.

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

Leave a Reply

Your email address will not be published.