SharePoint 2007 – JQuery to Fix Ugly Page Titles
One thing that I have always found quite annoying in SharePoint 2007 is that content page titles are ugly. For instance, if I create a new Web Part Page and give it the title “My Blog” with the URL “/pages/my_blog”, the title of the page in the browser ends up being “Pages – my_blog”. Quick ugly and not very user-friendly.
One solution to the issue that I have been using is setting the page title using JQuery. I have the JQuery library referenced in my Master Pages and I add the following into the Edit Source view of a blank Content Editor Web Part:
<script type="text/javascript">
$(document).ready(function() {
document.title = 'My Blog';
});
</script>Just note that this does not affect how search engines see the title of the page. Since they do not render the JQuery, they will still see the “Pages – my_blog”.
2 Comments
Leave a comment
Follow John Chapman
SharePoint StackExchange
- http://t.co/d2YzH8q1 - #sharepoint - [SharePoint 2010] Specifying Which Server a Custom Timer Job Will Run On
- Always have your stuff when you need it with @Dropbox. 2GB account is free! http://t.co/kczsnniq
- http://t.co/iLWV2Kwp - #sharepoint - [SharePoint 2010] Web Analytics: Monitors the health of the Report Consolidator component
Recent Posts
- [SharePoint 2010] Specifying Which Server a Custom Timer Job Will Run On
- [SharePoint 2010] Web Analytics: Monitors the health of the Report Consolidator component
- [SharePoint 2010 / SQL Server 2008] Query the SharePoint Object Model from a .NET SQL Server CLR Function
- [SharePoint 2010] Debugging a Custom SharePoint Timer Job
- [SharePoint 2010] Set Access Request Email for All SharePoint Sites

Do you really want to add a Content Editor to every page?
No, not at all. This is more of a one-off thing. If this needed to be accomplished on all pages, I would write a custom solution that adds a “Page Title” column to the pages library and set the page title programmatically using the AdditionalPageHead control.