Jump to content

Is There A Service That Counts Web Pages?

Recommended Posts

I was wondering if anyone out there knows of a service that counts the number of pages in a web site?


I'm looking for something that would allow me to plug in the domain name and then it would count all pages and sub-directory pages and give me the total pages that make up the web site.




Link to post
Share on other sites

Put this php script in the root dir of your site and run it. It will return the total number of files.


function direcho($path){global $a;if($dir=opendir($path)){while(false!==($file=readdir($dir))){if(is_dir($path.$file)){if($file!='.'&&$file!='..'){direcho($path.$file);}}else{$a++;}}closedir($dir);}return $a;}
echo direcho('./'); 

Link to post
Share on other sites

Ohh yeah you wanted just the pages and not all the files. Well this PHP script will give you the count of all the .html, .htm, and .php files in your site.


function direcho($path){
global $a;
if(strstr($file,".htm") || strstr($file,".php")){
return $a;}
echo direcho('./'); 

Link to post
Share on other sites

Thanks for those PHP scripts!


I'm actually looking to count the pages that are on other peoples' sites, not mine.


I thought I ran into something like that a few years ago online. You would just plug in the URL and it would spit out the total number of pages that were included on that site.


Thanks for the help.



Link to post
Share on other sites

Hey Nat,

See if Xenu will do what you want. It's technically a link checker but it does some good stuff. For instance I got this from your site. It looks better in their report than it does pasted here:


Statistics for managers

Correct internal URLs, by MIME type:

text/html 17 URLs 529035 Bytes (516 KB) 10.83%

image/gif 56 URLs 353424 Bytes (345 KB) 35.67%

image/jpeg 54 URLs 160297 Bytes (156 KB) 34.39%

audio/x-mpegurl 15 URLs 1111 Bytes (1 KB) 9.55%

audio/x-pn-realaudio 8 URLs 526 Bytes (0 KB) 5.10%

audio/mpeg 7 URLs 8160852 Bytes (7969 KB) 4.46%


Total 157 URLs 9205245 Bytes (8989 KB) 100.00%


All pages, by result type:

ok 257 URLs 69.09%

skip external 85 URLs 22.85%

skip type 6 URLs 1.61%

cancelled / timeout 17 URLs 4.57%

no such host 5 URLs 1.34%

connection aborted 1 URLs 0.27%

timeout 1 URLs 0.27%


Total 372 URLs 100.00%

Link to post
Share on other sites



That's exactly the sort of thing I am looking for!


Do you know where I can download a recent version of Xenu?


Thanks a million!



Link to post
Share on other sites

S'ok I did a search and found a download site for it.


Gonna check that out this evening.





Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...