Create a gist now

Instantly share code, notes, and snippets.

Recompile (re-evaluate) the URL associated with all Sitefinity blog posts
using System;
using System.Linq;
using Telerik.Sitefinity;
using Telerik.Sitefinity.Modules.Blogs;
using Telerik.Sitefinity.Blogs.Model;
namespace SitefinityWebApp.Extensions
public partial class test : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
var manager = BlogsManager.GetManager();
foreach (var post in App.WorkWith().BlogPosts().Get().ToList())
Response.Write(post.Title + "<br />");
var editPost = manager.GetBlogPost(post.Id);

I changed the UrlFormat property associated with my Sitefinity blog posts to change the URL generated for each post. Once this property is updated, the old blog posts continue to use the old URL until manually re-saved. I didn't want to manually click through and re-save each blog post, so I used the code above to automatically recompile the URL associated with each blog post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment