My Pages Have Been Redirected Automatically in WordPress. How to Stop It?

Yes, WordPress sometimes automatically redirects URLs under certain conditions when it detects changes in the permalink structure or slugs Check Permalink Settings: Go to Settings > Permalinks in your WordPress dashboard. WordPress Redirect Rules in .htaccess file Disable Plugins that Handle Redirects if any activated for WordPress dashboard If you have checked WordPress Core and … Read more

Incorrect Post URLs

I have checked the URLs and found that the Post URLs becomes https://michaelandpamstravels.com/?page_id=15204. Looks like your website permalink structure sets to Plain. To correct this I suggest you to go to Settings > Permalinks > Permalink structure, here you can update Permalink structure as per your need. Screenshot : https://ibb.co/t8tzFZJ

Get Page URl when changing slug and permalink

Instead of hardcoding the slug, instead store the ID in an option and then use it to call get_permalink(). You can also avoid hardcoding the $baseUrl and rely on a nav menu or button block instead so that it automatically updates. For example, $page_id = …..; // maybe a `get_option` call or something else? Depends … Read more

What is the correct url to request the 404 page?

Yes this this doesn’t work when you have custom permalinks enabled. See the red warning box on the page you linked: WARNING: If you are using custom permalink, the trick below does not work, see this: http://core.trac.wordpress.org/ticket/7592. The trac ticket was closed as invalid so doesn’t look like this will change.

url ends in “/embed”

This pages can be generated in WP, or by plugins and are intended to allow the page to be embedded on other websites. If you do not want them they can be “removed” via an .htaccess rule: RewriteEngine On RewriteCond %{REQUEST_URI} ^(.*)/embed/?$ RewriteRule ^(.*)/embed/?$ %1 [R=301,L] Or a custom function in your functions.php file: function … Read more

Remove links to the comments section

Add this to your theme functions file: // This will occur when the comment is posted function plc_comment_post( $incoming_comment ) { // convert everything in a comment to display literally $incoming_comment[‘comment_content’] = htmlspecialchars($incoming_comment[‘comment_content’]); // the one exception is single quotes, which cannot be #039; because WordPress marks it as spam $incoming_comment[‘comment_content’] = str_replace( “‘”, ‘'’, … Read more