Need some help with your project? Contact me

How to see the Node ID (nid) of a given Node in Drupal 7 if your URLs show alias paths

This is a quick tip for Drupal 7 to show how easy it is to see what is the Node ID of a given node if you use the module Pathauto or something else to create alternate URLs for your nodes.

It is quite simple really, but not the most obvious. When you first install Drupal and create nodes (with Clean URLs turned on), your node URLs look like something this: is in this case the Node ID). But what if you start using path aliases and the URL for Node 1 turns into

Easy. Go to Content and filter downt to find the content you want to see the Node ID for and hover over the Edit link. Look down to see the hyperlink your browser tells you it will follow if you click on Edit. 

There in the link you should see the URL to the node in its original [node/number] form. 

Hope this helps!


Nice one. I like

Cool. Thank you.

Thanks, It helps me a lot.

Thanks for the post

I needed that.

i like common-sense answers. Your eyes can cross when you try to find out from Google what to do. And frankly, I'd rather not write any php code just to get a node ID.


Thanks for posting this.

On most themes, You could also inspect the body tag, it has few classes, one of them being node-432

Thank You very much!
All the best

Thanks alot :) displays the nid in the Navbar module

Add new comment

You can post comments in Markdown and basic HTML tags.
For code blocks, wrap your code within '~~~'. For example:
$var = 'my variable';