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: www.example.com/node/1(1 is in this case the Node ID). But what if you start using path aliases and the URL for Node 1 turns into www.example.com/content/some-title?

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!

Comments

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.

Honestly.

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 :)

https://www.drupal.org/project/shownid displays the nid in the Navbar module

Add new comment

You must have Javascript enabled to use this form.