How do I bypass WordPress 404 handling?

If you have a non-static request like: example.tld/some-slug/ then you will need to run WordPress to see if that slug is available. The webserver (nginx/apache) doesn’t know that, because WordPress will have to inform us about that through the 404 response header. If your site has only few pages, then you could tell the webserver … Read more

404 to 301 – Fixing old links

If you intend to do checks based on template tags you should hook on wp action. template_redirect will suffice too, but wp is earlier. This is when WP handles 404 itself. To perform a 301 redirect use status_header( 301 );, wp_safe_redirect(); immediately followed by exit; You could use a plugin handle these for you. It’s … Read more

“Lost password” page triggers 404

Your theme or plugins are most likely modifying the “Lost password” link on your wp-login.php via the lostpassword_url filter. How do I reset the “change password” page to the WP default one? One would need to remove those filters callbacks. Here’s one (untested) suggestion: add_filter( ‘lostpassword_url’, function( $url, $redirect ) { remove_all_filters( ‘lostpassword_url’ ); return … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)