.html Wordpress permalink on PAGES plugin
May 2, 2008 – 5:55 pmRecently creating a Wordpress site and i noticed a little problem, you can add .html in the settings which work fine for POSTS but not pages!
I wrote a small plugin that will add the .html to the end of PAGE urls, it will add the .html to the pages menu and add .html to the page slug when writing a new page.
You will need permalinks activated obviously
Just upload to your plugins folder, activate and away you go!
Links return to normal when you deactivate.
Removes trailing slash ( .html/ ) if you use them in permalinks.
Works on subpages.
Tested Wordpress 2.5.1 up to 2.7
Works well for me on Wordpress 2.7, hope it works ok for you too.

101 Responses to “.html Wordpress permalink on PAGES plugin”
Seems to work very well on my blog. thanks for sharing.
By Grace on Jun 16, 2008
Great Plugin! Works like a charm!
Is there any way to tweak this plugin to exclude specified pages? …or the other way around, only work on one or two pages?
By Andreas on Jun 24, 2008
very cool. Thank you for providing this. Works great on my 2.5.1 install as well.
–doug
By munsinger on Jul 2, 2008
Thanks, I was searching forever at the wordpress extend website. It worked like a charm!
Thanks a lot
By kingguffster on Jul 11, 2008
It’s amazing how just a few lines of code can have such an impact. Thanks for putting this together! I’ve been scratching my head about what I was doing wrong, but now I know it’s just a WordPress “feature”
By Marios Alexandrou on Jul 22, 2008
How can I modify the plugin to enable my pages to end in “.php” instead of “.html” ?
I’m trying to migrate a site with .php page extensions into a cms wihtout having to do 301 redirects.
thanks
By Michael Erb on Jul 23, 2008
thank you!
does someone know how to make it wp 2.6 plugin ready so it shows up in plugin directory and we can activate and deactivate it?
By jason on Jul 26, 2008
oops! my error, it is wp 2.6 ready to activate / deactivate. cool. ok, but how do we get the static home page to have a static url permalink with .html?
By jason on Jul 26, 2008
Hi. I tried this plugin with WP 2.6.1 and created a page. I then tried to look at the page, and was greeted with this message:
Forbidden
You don’t have permission to access /wordpress/.html on this server.
Apache/2.0.46 (CentOS) Server at billkath.co.nz Port 80
What is wrong? Isn’t the plugin working for my site? I guess I’ll have to de-activate it.
Cheers,
Kath
By Kath on Sep 8, 2008
I have waited six days, and still my other comment has not been moderated. This forum does not seem to be active or functional.
By Kath on Sep 14, 2008
sorry this is not a forum, but i will try to help if i can.
kath, do you have permalinks on??
By admin on Sep 14, 2008
how to remove the ending slash?
from
http://www. mysite.com/page.html/
to
http://www. mysite.com/page.html
By robert on Oct 2, 2008
Is there any chance you can write this plugin to work for category pages as well?
Thanks!
By Michael on Oct 19, 2008
Thanks so much. I use Wordpress as a CMS for small sites so this worked perfectly!
By kb on Oct 28, 2008
Thank you.
By Mizpah on Oct 31, 2008
Hi, Please help me. I uploaded the file and added 2 posts and .html is not coming.
Waiting for an early reply
Thanks,
Paul
By paul on Oct 31, 2008
The .html appears on pages not posts
By admin on Oct 31, 2008
Thanks, it works great!
@ Paul - u can set .html for posts from wordpress -> settings -> permalinks , just type .html after %postname% like this:
/%year%/%monthnum%/%day%/%postname%.html
By Real HS on Nov 3, 2008
This has become a standard plugin I use on all my installs.
Thanks for sharing!
DAN
By Dan Poynor on Nov 5, 2008
Works fine on 2.6.2 but not properly in 2.6.3. The line above the post/page editor where you type the page name does not appear at all.
By Ian Forest on Nov 14, 2008
Works fine for me on 2.6.3
Thanks for sharing
By dave on Nov 14, 2008
Hi, I am using Wordpress 2.7 and it doesn’t appear to work in this version.
Any ideas what to do?
By Chris Flattley on Nov 18, 2008
New version now available
.html on Pages Plugin for Wordpress 2.7
By admin on Nov 19, 2008
Excellent plugin.
Too bad it dont cooperate with the Google XML Sitemaps plugin. My sitemap.xml file isnt valid if I enable .html to pages
By Lars on Nov 20, 2008
hi. Thanks for plugin
perfect.
Regards
By baron on Nov 20, 2008
Lars, i dont see any problems with Google XML Sitemaps plugin, all valid XML ?
Please describe the problem
By admin on Nov 20, 2008
The XML is valid, but the Sitemap plugin dont add .html to the static pages, so my sitemap points to domain.tld/page but the page is now only avalable from domain.tld/page.html
When accessing domain.tld/page you get a 404, so searchengines relying on the sitemap will be right confused.
By Lars on Nov 20, 2008
Lars, ive tested this and it adds .html on the url’s in my sitemap.xml, strange
When i generate the sitemap without the plugin i get .tld/page then activate the plugin regenerate the sitemap and its .tld/page.html
By admin on Nov 20, 2008
Ok…. It donesnt do that on my end. I’ll do some more checking and come back to you.
By Lars on Nov 20, 2008
I’m new to WP but using it as CSM and everyhing seems to work fine w/o he .html exension. What is the advantage of adding .html extension to WP pages?
Thanks
By Rhonda on Nov 21, 2008
Just tested this plugin, on a WP 2.6.3 install.
Plugin doesn’t work here also.
It even mixes up the links!
A link to a page became domain.tld/category/id/post-name/name-of-page
So I disabled the plugin awaiting future updates…
By GJtje on Nov 22, 2008
Made a typo in last comment…
The URL became domain.tld/category/posting-id/name-of-page
By GJtje on Nov 22, 2008
GJtje, what other plugins you using?
This appends .html to page_structure so something else must be changing page_structure
By admin on Nov 22, 2008
I’m using quite a lot of plugins.
But they’re all needed so I can run my site properly.
I think the redirection plugin may interfere?
By GJtje on Nov 23, 2008
What’s the point of this plugin? What’s the difference with using the Permalink Options and picking a permalink structure like /%postname%.html ?
By Ozh on Nov 23, 2008
using the Permalink Options and picking a permalink structure like /%postname%.html wont add .html to your pages url’s
By admin on Nov 23, 2008
The problem with adding the .html extension to your posts, and pages, means your categories are not properly terminated, e.g. yoursite.com/category/wordpress
whereas it should really be: yoursite.com/category/wordpress/
By Bruce on Nov 24, 2008
bruce, yes thats true, Wordpress only adds the trailing slash if you do so in your permalink structure.
I use http://www.fastagent.de/res/download/smart-trailing-slash.zip to make sure i have the trailing slash when needed
By admin on Nov 24, 2008
Excelent!! works in imágenes para hi5
Thanks
By imagenes hi5 on Dec 1, 2008
Doesn’t seem to work on 2.6.5.
By WordPress Lounge on Dec 3, 2008
Works fine for me on 5 installs of 2.6.5
More details please - Errors displayed etc
By admin on Dec 3, 2008
I’m using WP 2.6.5.
The plugin works great for the most part, but it still allows a slash after my blog page.
Some info for better understanding:
My permalink structure:
/blog/%postname%.html
This is so that all blog posts are in a ‘blog’ directory. For example, a post would appear as:
mywebpage.com/blog/here-is-a-post.html
All of my other pages appear at the root, i.e.:
mywebpage.com/about.html
WP points the blog posts to my ‘blog’ static page (via Settings > Reading > Front Page Displays - then it points to my ‘Blog’ page). So the blog page is:
mywebpage.com/blog.html
And using this plugin, even though it makes WP link to:
mywebpage.com/blog.html
The page still loads as:
mywebpage.com/blog.html/
I’ve even tried using the ‘Smart Trailing Slash’ plugin, but to no avail.
Is there a fix for this? Thanks in advance for any help you can provide - and for the great plugin!
By Brian on Dec 6, 2008
Brian,
The reason for this happening is because by using a PAGE as a static page for POSTS you are converting your chosen PAGE from a regular PAGE to a POST category page.
Hope that helps.
By admin on Dec 6, 2008
hi, funky plug, works fine
but:
1. domain.tld/parent/page.html
works fine
2. domain.tld/parent/parent/page.html
the .html is missing, why?
Question: is it possible to shrink all the parents to one page like:
domain.tld/parent-parent-page.html ?
thats my wish for christmas
rock on.
(in the meanwhile i will try to “hack” your plug - if it works, i will send you a copy…)
By seek on Dec 7, 2008
seek,
cant see why you are getting that problem,
i have a site with upto domain.tld/parent/parent/parent/parent/page.html without any problems
By admin on Dec 7, 2008
Thanks for your quick reply!
I’m relatively new to Wordpress, is there some way to work around the fact that the plugin causes POST category pages to display as “.html/”? As I mentioned above, the only time this is an issue on my ‘blog’ page, since it’s a static page functioning as the ‘Index’ page normally would.
I’ve done some searching, but since your plugin is simultaneously the solution to one of my problems and the creation of a new one I’m not having much luck.
Thanks in advance for any help you can provide!
By Brian on Dec 8, 2008
sorry, my bad - pages with parents works…
but, what do you think about my christmas wish ?
greets from germany
By seek on Dec 8, 2008
seek, glad its working ok
Not sure about your wish, will have a play when i get time
By admin on Dec 8, 2008
I have the same problem as some others, I need two of five pages to point to .php files, part of a forum linked to my blog.
Anyone have an idea how I can work around this, leave my permalinks and pages to wp files alone, then have the two forum pages point to .php files?
thanks!
eric
By Eric on Dec 16, 2008
I have activated the plugin but i don see .html at the end of the pages..Suppose i click on one of my post links i don get .html at the end of the link .. what could be wrong…??
By Sid on Dec 18, 2008
Hi,it works on PAGE links not POST links, set .html in your permalink settings for POSTS
HTH
By admin on Dec 18, 2008
Working like a charm on my Site but i have 2 Questions
1) how to redirect a link indexed in search engines to the new permalink?
for example: yoursite.com/category/postname/ to yoursite.com/category/postname.html
2) how do we disable it for pages or what should we do with the code so that it starts working with pages as well. because it is not working with a plugin on my site, “Dagon Design Form Mailer v5.41″
By Janan on Dec 19, 2008
Great plugin.Thank you
By Avsa on Jan 5, 2009
I tested in wordpress 2.7 and not work.
Can you help me please.
By Andre on Jan 7, 2009
Is there a simple way to modify this plugin to add .html to the end of category pages? I’d even be happy with it adding .html to the end of every url (page/post/category/ect)
In order for what I’m after to work, I need to have .html at the end of “every” document. I am trying to setup a system where I write updates to a website in wordpress as posts or pages in an offline environment. Then I want to backup the whole site using wget and publish it online as a static site. (without the cms)
Your plugin almost has it working, but there are still a few category pages that I can’t seem to get .html onto the end of.
By Graphpaper on Jan 16, 2009
The problem that some people are having with your plugin is that the plugin, when downloaded from the WordPress codex, doesn’t work. While the plugin downloaded from this site doesn’t work. You might want to look into that.
By Chris on Jan 17, 2009
Chris, you say both dont work? ive just tried the plugin on 2 different installs downloaded from both the codex and here, both working fine for me.
The codex and here are the same files
By admin on Jan 17, 2009
Wow… great plugin… thank you so much
By Rupal on Jan 28, 2009
This will be the a saving grace for many people, good job
By everysongsaboutagirl.com on Jan 29, 2009
Does anyone know if there’s a plugin that makes this work for categories and tags, for example:
http://www.blog.com/category/music.html ?
By neondragon on Feb 8, 2009
Perfect! Just what I was looking for. I’m using version 2.7 and it worked.
By Saltbar on Feb 9, 2009
hi
iam facing one problem with the permalinks for pages.
my current url is http://www.abc.com/page/aboutus and this url i want to change it to
http://www.abc.com/aboutus …so for this the page should be removed ..i have tried with the several plugins .but still its not working ..
any other options plz help me out..
By mitra on Feb 19, 2009
I’m also having the problem of my google XML Sitemap NOT changing to reflect the added .html to my pages. I tried uninstalling the sitemap plugin and deleting the sitemap to force it to be recreated, but I still can’t get it to work. I’m running Wordpress 2.7. and I have all these plugins installed:
All in One SEO Pack
cforms
Custom Admin Branding
Google Analyticator
Google XML Sitemaps
pageMash
TinyMCE Advanced
wp-cache
XML Google Maps
Any suggestions would be appreciated. I much prefer the natual look of the .html extension, versus Wordpress standard /slash/ treatment.
By Jane on Feb 22, 2009
Jane,
Ive just tried the plugin with ALL your listed plugins and it works fine for me?
I have a sitemap.xml without the .html, i then activate my plugin, visit the homepage to check the the .html has been added, then go to xml sitemap settings, click “manual rebuild”, wait a few seconds for it to be rebuilt, then click on sitemap.xml, the sitemap loads in my browser, i then do a ctrl+f5 to refresh thre browser cache and see the new sitemap with the .html, the reverse removes the .html again.
By admin on Feb 22, 2009
Oh that darn Browser Cache!!! Yes, that was the problem. Thank you so much. Now it’s working properly. Fabulous little plugin! Thanks!
By Jane on Feb 22, 2009
Hi, thanks for this great script. I make all pages with .html (domain.com/parentpage/subpage.html)
but parent pages looking like domain.com/parentpage.html, i want it like domain.com/parentpage/ only for parent pages.
How can i manage it using your scripts,
Thanks for your time and effort to make this great script again.
By Okan on Feb 27, 2009
Great Plugin, I hated those pages without “.html” at the end.
Works great on WP 2.7.1 !!!
By Antonio on Feb 27, 2009
dude, u are a genius. thank you very much!!!!
By AlexRO on Mar 2, 2009
Thanks a lot. You save me lots of trouble. I’m working with client migrating his retail site to Wordpress without comprising his URL’s. I was about to experiment on modrewrite but your solution is better.
By rev on Mar 6, 2009
I installed this on 2.7 today. I had a wierd problem where the plugin caused the page templates to not be found (I think - because it caused 404’s in the middle of the page, but loaded the archive.php template [i think]).
I unactivated and reactivated the plugin and it started working beautifully.
For anybody who is getting 404’s on all except for the home page you may want to try this. I just put this on a development site but will rollout to the production site now to see if the same thing happens.
By Shaun on Mar 31, 2009
Really good and useful plugin, thanks for share.
By Photowork on Apr 4, 2009
awsome, i had been modifying various include files to acheive the same results.. but i would have had to modify those same files with every wordpress update.
one issue still exists, that is with split pages
if you have a page ie: somepage.html and you use the tag to split it into mulitple pages, the second page link becomes somepage.html/2
argh
By Adam on Apr 6, 2009
@ Mitra,
You have to set up your database.
By Uttam on Apr 9, 2009
Hi there,
i am using this plugin on my site(2.7) since last 6 months and i am quite happy with it as i didn’t face any problem except “Dagon Design Form Mailer v5.41″ but it wasn’t a major issue.
now i want to add a plugin wp-super-cache to my blog, i didn’t give it a try yet on my blog as i was unable to find your .html permalink on their compatible plugin list.
i was just wondering if you would please check your Plugin’s status with wp-super-cache and add it to their compatible plugin list.
regards
By Janan on Apr 10, 2009
Hi, I`m using your plugin - it`s great. But I also use the dagon design sitemap and this causes your plugin to produce a strange result:
when dd-sitemap lists more than 50 links on one site it produces another site and in the original permalink-structure it looks like domain.de/sitemap/2/ but your plugin produces something like domain.de/sitemap.html2/
Any suggestion how to fix this ?
By Markus on Apr 25, 2009
Thank you for sharing this plugin. Its very useful for beginner like me. Finally you save me…
By lynn on Apr 30, 2009
Great tool! Does somebody know how to remove the parent for pages in Worpress? Example: http://www.yoursite.com/PARENT-PAGE/yourpage.html
This drives me nuts. Also I see a lot of guys searching for a solution:
http://forum.bytesforall.com/showthread.php?t=1479
http://wordpress.org/support/topic/216679
Any ideas?
By MadMax1404 on May 2, 2009
Nice plugin, easy to use, really good job, thanks.
By Adrian on May 6, 2009
Thank you so much! I have searched high and low for plugins that will do this and even installed two plugins that didn’t work.
@Shaun: thank you so much for your comment, the plugin didn’t work for me at first and I was bummed but then I did what you suggested, with the turning off and on, and it worked!
WP version 2.7.1
By Ittai on May 8, 2009
Plug-in breakes site,
When activated it only add’s .html
and all the pages break.
Any Idea’s
By TechyForever on May 11, 2009
Why end of my catalog is not show .html , this is my website http://www.forextradingsystems.biz ?
By Nipon Ekanarongpun on May 20, 2009
@Nipon Ekanarongpun
Your pages all appear to have .html, you need to set category with permalinks
By admin on May 20, 2009
I added the plugin then uninstalled it because while the pages had the .html appended to them, when I clicked on them in the navbar, I got the following error:
Not Found
Sorry, but you are looking for something that isn’t here.
This happened with all the pages, and they all had content on them. I’ve since deactivated the plugin hoping to find the cause for this.
By Krystyna on May 26, 2009
Somehow or another, by some miracle, I got it to work. For those having trouble, don’t ask me for guidance, because I’m not sure what I did, besides deactivating it and reactivating.
By Krystyna on May 27, 2009
Fantastic plugin solves me half a day of getting it right the manual way. Tweaked it slightly to .htm and it’s working fine on WP 2.7.1 thanks!
By Karen Marree on May 29, 2009
I’m using your plugin on a 2.7.1 site and I am running into a problem.
In the Settings > Reading settings page, under the “Front page displays:” option. If I change the “Posts page:” to an existing page, that page returns a 404 error. The page works fine until I set this option.
Any suggestions?
Thanks,
Graydon
By Graydon on Jun 8, 2009
Update to my last comment…
It’s working now. However, the url for my “Posts page” is ending with a trailing slash.
Like this:
http://www.somedomain.com/articles.html/
By Graydon on Jun 10, 2009
How about WordPress 2.8 ?? Not working on 2.8 version
By NepaliHotels.com on Jun 21, 2009
Tested working fine on 2.8
By admin on Jun 21, 2009