Is a permastruct possible on pages?

Yes this is possible using the $wp->add_query_var function used together with add_rewrite_rule . Here you have an example: Passing and retrieving query vars in wordpress If you want more help here is a cut from one of my old plugins: function createRewriteRules() { global $wp_rewrite; $new_rules = array( ‘(.?.+?)/(stenskott)$’ => ‘index.php?pagename=”.$wp_rewrite->preg_index(2).”&ort=”. $wp_rewrite->preg_index(1), “(.?.+?)/(bilclas)$’ => ‘index.php?pagename=”.$wp_rewrite->preg_index(2).”&ort=”. … Read more

Custom rewrite_rules – only pass numbers and not alphabetic characters

Instead of index.php/reco/?b=$1, try this: “$wp_rewrite->index?pagename=reco&b=” . $wp_rewrite->preg_index( 1 ) You should also append a $ to your reco/([^/]*)/? regex to ensure the rule only matches the entire path, and not just the beginning. Then flush your rules afterwards (just re-save your permalink settings in admin). Update: Try using the page_rewrite_rules filter instead, and use … Read more

Performance impact of rewriting WordPress URLs

From performance point of view what takes time is matching URL against generated (and stored persistently so it’s not rebuilt continuously) list of regular expressions. Since URLs are (most of the time) insignificantly short in text volume the amount of those regular expression rules has most impact on performance. Unless you generate unreasonably many rules. … Read more

Hide admin login without plugin

There is an action hook called login_init. It’s also called on the registration page. You can simply attach wp_die() to it. You might want to disable the entire backend as well, which can be done by hooking into admin_init. add_action( ‘login_init’ , ‘wp_die’ ); add_action( ‘admin_init’ , ‘wp_die’ ); WordPress will exit with an empty … Read more