How to remove file versions from the file source links in wp_head?

You can hook into style_loader_src and script_loader_src and run remove_query_arg( ‘ver’, $url ) on the URL: <?php /* Plugin Name: Remove version parameter for scripts and styles */ add_filter( ‘style_loader_src’, ‘t5_remove_version’ ); add_filter( ‘script_loader_src’, ‘t5_remove_version’ ); function t5_remove_version( $url ) { return remove_query_arg( ‘ver’, $url ); } Without this plugin: After plugin activation: There is … Read more

Unwanted media library URLs in posts?

This thing you are saying is unwanted is just normal functionality under WordPress and it cannot be removed. However there are things you can do to point the unwanted URL to something more usefull. Here is a forum post on this issue with some interesting fixes and a description on what is happening: http://wordpress.org/support/topic/disable-attachment-posts-without-remove-the-medias Attachments … Read more

Custom plugin route in WordPress

You need to do three important things: Create a custom rewrite rule to turn parts of the URI into values passed to index.php. Add myroute and myargument to WordPress’s query variables whitelist, so that WordPress doesn’t just ignore them when they appear in a query string. Flush the rewrite rules. Firstly, I’m going to recommend … Read more

Redirecting to old domain after migration

My issue is resolved, I am posting this as an answer so that someone else can benefit out of it. My issue was, siteurl and homeurl were not updated, so I have placed define(‘RELOCATE’,true); in my wp-config.php file. And again tried to access the website , it gone to the correct URL but all the … Read more

How does routing on wordpress work?

In WordPress, URLs don’t map to routes. They map to database queries. When using WordPress in the “default” permalinks mode, you have a set of variables in the main URL query, like ?p=1 or ?page=234 and so forth. There’s also ?s=search and many others. If you use the “pretty” permalinks, then a big set of … Read more

How does WordPress generate URL slugs?

As per @SinisterBeard‘s very valid comment to the question already a couple of years back now, this answer has long been outdated and the mentioned function(s) hence been replaced by a newer API: See wp_unique_post_slug. Original Answer Off the bat, I can’t give you a page/tutorial/documentation on how WP slugs are generated, but take a … Read more

Detecting a WordPress URL without doing a full HTTP GET?

From my experience and quick code search there are no deliberate ways WP identifies itself in headers. However there are some that seem distinct enough and not likely to be customized. HEAD to /wp-login.php will contain following for .org install: Set-Cookie: wordpress_test_cookie=WP+Cookie+check; path=/ And for .com: Set-Cookie: wordpress_test_cookie=WP+Cookie+check; path=/; domain=.wordpress.com Cookie name is customizable by … Read more

Why “?v=hash” is added to my URLs? [closed]

It was woocommerce, it has a setting “geolocalize users with cache support” which adds this parameter to every single url and link. I noticed that the hash appended was the same in every browser on my computer, so I realized it wasn’t a “session” hash, but an IP address hash.