Get current page URL in WordPress

Get current page URL in WordPress

Here is a handy snippet with which you can easily get current page URL on your WordPress website. It doesn’t matter if you need it on single post, page, home, category, tag, custom post type or any other WordPress template.

You can use this piece of code inside any template on your WordPress website:

That’s it, feel free to try!

Bojan Petrovic

Co-founder and WordPress developer at Meks. He has been involved in the business since 2009. creating themes, plugins and services on top of WordPress, continuously aiming to choose best approaches and work smarter, not harder.

30 comments

Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *