![]() |
Forum Site Map for Search Engines
Just a very quick hack that will print a static php page listing your categories and topics.
Search engines like Google wont index a dynamic URL off a dynamic URL so by providing a static page listing your topics dynamic URL's you will get a deeper crawl. I know there are different approaches on this board to optimizing for Google, but try this as well. It works :) I then just create a link from the home page to the this file (you should try and name it sitemap.php or something similar. Please note that I have deliberately not used any vbulletin templates etc... the goal of this page is to be as simple and clean as possible for crawlers like Google and AlltheWeb to index as much as possible. Example of output here: http://www.sizematters.com.au/forums/sitemap.php Just cut and paste the code and play. In another version I made it so the first 100 characters of the first post in each topic was created, but I dont think it helps much. PHP Code:
NOTE: This version WILL show contents of private forums if you have them. If you have certain forums you dont want to have their content listed - see the revised code a couple of posts below. |
Nice idea, ofcourse for a larger forum the listing of threads can get very long ;)
One thing though, the use of mysql_query could have been replaced with $DB_site->query, since it's specified for vBulletin. |
Excellent hack, and you did a nifty job in the CSS of it as well.
Here is another demo for anybody wondering: http://www.diffusion4.com/sitemap.php |
Spankyou :)
If the topics get too long it wouldnt be too hard to put in a previous / next link - but that would again run into the problem of dunamic url off a dynamic url :) |
this shows the topics of private forums, is it suppose to?
|
Shows everything. I hadnt thought about pvt forums. Could add a bit of code where it wouldnt.
|
I dont have any pvt forums so not sure how they are flagged so cant see anything obvious to edit for now.
|
You have a small in the listing of the top 20 recent-threads, as you forgot to order it by dateline.
#1. Find: PHP Code:
PHP Code:
|
Thanks - I initially had it for some reason but took it out...
If you want to EXCLUDE some categories - eg private areas use this code: PHP Code:
|
Because it uses the same code layout - heres a REALLY quick and dodgy hack to display Private Messages
PHP Code:
|
I suggest you place the php code in a text file, so that it is hidden from unlicensed members, and so that members can download it onto their hard disk. Good idea, btw. :)
|
Works well. Thanks!
Max. |
Is there a way with META NAME keywords to force Google not to index the forums, but only to index this file?
Something in the likes of: META NAME="ROBOTS" CONTENT="INDEX,NOFOLLOW" and in the normal forums: META NAME="ROBOTS" CONTENT="NOINDEX,NOFOLLOW" or wouldn't that make a difference? If so, where would I place the META NAME? In the header template? |
Well - you would simply use a robots.txt file - much easier in my opinion, but I would never restrict Google from trying to index anything.
|
What if you have some forums that you still have in your control panel but you have them turned off to not show on your forum. Code still shows them. How to exclude those types of forums from the map?
|
Works great! I have it installed on both of my sites.
|
is there a way to make this work off a template ? so we can include $header and $footer ? :)
|
How would i go about making the page adobt the header and footer templates so it looks like a normal page not just a doorway page?
Thanks Matthew |
I made it deliberately so that you wouldnt have headers and footers - or anything to distract the search engines from their job of indexing :)
Having said that though a header and footer can EASILY be added. Its just a html file after all. Add your header and footer before and after the php code. |
Looks great man !!
|
Google has posted some new guidelines, and one point about site maps is that they should contain less than 100 links. I wonder if this can be modified to spread over a number of pages?
|
With so many links on one pages, this makes it look like a Linkfarm, and search engines don't like those. Listing 50 posts at a time would make the Googlebot more happy.
|
I havent had any problems with over 1,000 links on a page :)
Depends on your PR as to how many will get crawled... |
well it definetly worked on my sites. I have tons of hits from the sitemap everyday, but I checked my server log and JUST the sitemap.php file is using almost 3GB of bandwidth a month. Any way to gzip the output and possibly shorten it to only include a hundred or so links?
|
can i make it also for only categories
or only the newest 50 topics? |
I checked and even your sitemap (the one on the 1st page) is almost 1MB in size. That's a ton of bandwidth.
|
I dropped the file in vbfolder/sitemap/index.php and changed ../global.php but nothing seemed to work. Any idea why?
|
All times are GMT. The time now is 06:28 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|