Meta Name Description Tag

Topics: Controls
Dec 15, 2009 at 11:09 PM

Would it be possible to automatically create a meta description tag for posts? Say with plain text of the first 150 characters from the actual post?

The reason I ask is that I'm testing the import from another blog - using BlogML - and for all the imported blog posts - there are no descriptions.

Would this be a candidate for a custom user control?

Sep 17, 2012 at 4:35 PM

I have the same problem... today... someone can help me?  i want a meta description that take first 20-30 words of my post or model words with title...

it's possible???

thank you

Fabry

Sep 22, 2012 at 5:45 PM
Edited Sep 23, 2012 at 12:46 AM

Hi,

I have made an Pro Edition of BlogEngine.Net that handles all of the Meta Tags and SEO related issues.

Check it out here and test it out for your self:


Http://Pro.Kbdavis07.Info

 

As of now its only for BE 2.5

 

But, if there is a need for it can upgrade it to BE 2.6

 

Here are some screenshots:

Posts:

http://www.diigo.com/item/image/17qct/suhr

Pages:

http://www.diigo.com/item/image/17qct/dajt

 

Check out a live site using it:


http://kbdavis07.info

 

 

Look at the source code of the Hhtml for all of the pages and posts, archive, Contact and others each has their own custom meta tags.

 

<meta name="description" content="Contact Page For Brian Keith Davis" />
<meta name="keywords" content="contact,feedback,comments,apply,programming solutions" />
<title>Contact Page For Brian Keith Davis</title>

Tags:

 

<meta name="description" content=" All posts that are tagged Extensions" />
<meta name="keywords" content="Extensions" />
<meta name="ROBOT" content="NOINDEX, NOFOLLOW" /> <-- Tries to Keep search engines from indexing

<title>All posts tagged 'Extensions' </title>

Every page,post,tags, and etc has their own meta tags information.

Also they each have two "titles"  a page "title" and an "Meta" Title that is display in the web browser.

This makes it possible to have a title for web links that are different from what the search engines will see.

 

Also comes with SEO redirector already configured to work out of the box too

Sep 23, 2012 at 5:38 PM

I don't want to sound critical, but Ben, Ruslan and the other incredible developers on the BlogEngine.NET Core Team created a phenomenal application which is already "Professional" in every respect.  I don't think it's right for someone to add a few SEO enhancements and calling it "BlogEngine.NET Pro Edition."  That to me is an insult to the talent and dedication of those who made BlogEngine.NET what it is today.

-Dave

 

Sep 24, 2012 at 1:06 PM

Calm guys, thank you kbdavis07 for your work and for your good idea, i don't want to enter in your discussion but i have soved this problem with simple extensions of Andrea dottor <cite> </cite>without the need to change platform BlogEngine.net 2.5 ..

#region using

using System;
using BlogEngine.Core;
using BlogEngine.Core.Web.Controls;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.UI.HtmlControls;

#endregion

/// <summary>
/// Set the meta description in the page.
/// </summary>
[Extension("Set the meta description for the post", "0.1", "Andrea Dottor", 100)]
public class MetaDescription
{

    /// <summary>
    /// Initializes the <see cref="MetaDescription"/> class.
    /// </summary>
    static MetaDescription()
    {
        Post.Serving += new EventHandler<ServingEventArgs>(Post_Serving);
    }

    /// <summary>
    /// Handles the Serving event of the Post control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="BlogEngine.Core.ServingEventArgs"/> instance containing the event data.</param>
    static void Post_Serving(object sender, ServingEventArgs e)
    {
        const int m = 5;
        if (!string.IsNullOrEmpty(e.Body)
            && string.IsNullOrEmpty(((Post)sender).Description)
            && e.Location == ServingLocation.SinglePost)
        {
            // Remove the HTML tags
            string content = ClearHTMLTags(HttpUtility.HtmlDecode(e.Body));           
           
            // Remove the encoded char. es: &#236;
           // content = ClearEncodedChar(HttpUtility.HtmlEncode(content));

            // Reduce the Length of text for meta description
            if (content.Length > 300)
                content = content.Substring(0, 300);          
             

            ((Post)sender).Description = content;
        }
    }


    /// <summary>
    /// Clears the HTML tags.
    /// </summary>
    /// <param name="strHTML">The string with the tags to remove.</param>
    /// <returns></returns>
    private static string ClearHTMLTags(string strHTML)
    {
        Regex regEx = null;
        string strTagLess = string.Empty;
        try
        {
            //this pattern mathces any html tag
            regEx = new Regex("<[^>]*>", RegexOptions.IgnoreCase);
            strTagLess = regEx.Replace(strHTML, "");
            //matches a single <
            regEx = new Regex("[<]", RegexOptions.IgnoreCase);
            strTagLess = regEx.Replace(strTagLess, "&lt;");
            //matches a single >
            regEx = new Regex("[>]", RegexOptions.IgnoreCase);
            strTagLess = regEx.Replace(strTagLess, "&gt;");

            return strTagLess;
        }
        catch
        {
            return strHTML;
        }
    }

    /// <summary>
    /// Clears the encoded char.
    /// </summary>
    /// <param name="strHTML">The string with encoded char to remove</param>
    /// <returns></returns>
    private static string ClearEncodedChar(string strHTML)
    {
        Regex regEx = null;
        string strEncodedCharLess = string.Empty;
        try
        {
            regEx = new Regex(@"&(?ni:\#((x([\dA-F]){1,5})|(104857[0-5]|10485[0-6]\d|1048[0-4]\d\d|104[0-7]\d{3}|10[0-3]\d{4}|0?\d{1,6}))|([A-Za-z\d.]{2,31}));", RegexOptions.IgnoreCase);
            strEncodedCharLess = regEx.Replace(strHTML, "");

            return strEncodedCharLess;
        }
        catch
        {
            return strHTML;
        }
    }

}

Bye Fabrizio

 

Oct 1, 2012 at 12:36 AM
daveburke wrote:

I don't want to sound critical, but Ben, Ruslan and the other incredible developers on the BlogEngine.NET Core Team created a phenomenal application which is already "Professional" in every respect.  I don't think it's right for someone to add a few SEO enhancements and calling it "BlogEngine.NET Pro Edition."  That to me is an insult to the talent and dedication of those who made BlogEngine.NET what it is today.

-Dave

 

 

Hi Dave,

I am sorry if I offended or insulted any body talent and dedication to all that who made BE.

I did not mean that to happen.

I had created an customized version of BlogEngine.Net which not only have a "few" SEO enhancements it also have a "PageLinkMenu" feature that allows it to operate as a mini-CMS by giving users total control of their pages.

 

http://kbdavis07.info/post/PageLinkMenu.aspx

It also has more features and going to add more later when I have time.

 

The ideal of the name "Pro Edition"  is because it has features that not all average users would use but "power" users would find useful.

 

It also have lots of settings and extensions pre-installed and configured so its an "out of the box" package.

 

Users would not have to configure these things them self's like Elmah and etc.

 

They just upload and go.

Again I by no means tried to offend or insult any body by this and if this has occurred then I am truly sorry. 

 

I have great respect for everybody here.

 

Ben

Ruslan

Others on the development team and everyone on this forum.

 

Also you Dave with your integration efforts with

Sueetie

http://sueetie.com/

You had done great work with that too! :)

 

Have a great day,

 

Brian Davis

 

 

 

 

 

Oct 3, 2012 at 9:23 PM

Brian,

If our mutual heros Ben and Rtur don't mind the "Pro Edition" handle--and they obviously don't and neither does anyone else--then I was out of line.  Please accept my apologies and forget I ever mentioned it.  Good luck with your enhanced release of BlogEngine.NET!  

-Dave

p.s. Thanks for the kind words about Sueetie.  

Oct 3, 2012 at 9:51 PM
Dave, brian
you are good programmer but one of you can to find solution to my problem at discuss still open: http://blogengine.codeplex.com/discussions/397380
Thanks
Fabry

Inviato da iPod

Il giorno 03/ott/2012, alle ore 23:23, "daveburke" <notifications@codeplex.com> ha scritto:

From: daveburke

Brian,

If our mutual heros Ben and Rtur don't mind the "Pro Edition" handle--and they obviously don't and neither does anyone else--then I was out of line. Please accept my apologies and forget I ever mentioned it. Good luck with your enhanced release of BlogEngine.NET!

-Dave

p.s. Thanks for the kind words about Sueetie.