Remove Permalink of certain posts

if you want to redirect a few posts to 404 page then you can use use the following snippet in functions.php of your child theme. add_action( ‘template_redirect’, ‘post_redirect_func’ ); function post_redirect_func(){ global $post; $redirect_url = get_template_part( 404 ); // you can write here the page to redirect if this don’t work for you if ($post->ID … Read more

How to add rewrite rule for product compare page?

Here you go: compare\/([^-vs-]*)(?:-vs-)([^-vs-]*)(?:-vs-)?([^-vs-]*)? Remember to escape backslashes (as I have done). I also made your lookups more consistent in their internal logic/structure. I assumed you wouldn’t want a second -vs- if the third product wasn’t there, so this is why you now have the second non-capturing group. Here is a link with the answer … Read more

while changing permalink, page redirected you too many times

Have you checked the website URL settings? There might be something wrong in the configuration. Follow these steps: Head to Settings > General Settings. Make sure that WordPress Address(URL) and Site Address(URL) are the same. If you don’t have access to the wp-admin area, you can update the URLs using the wp-config.php file. You can … Read more