Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7678797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:43:48+00:00 2026-05-31T17:43:48+00:00

I have a CMS running. I am seeing that my CMS users are entering

  • 0

I have a CMS running. I am seeing that my CMS users are entering special characters coming from copy & paste actions in Word, etc.

So in the meta description content attribute I am seeing a diamond in place of a slanted single right-quote.

I went into the database and changed the single quote to ’.

So my CMS now renders it’s, for example.

I am trying to do conversion on the string during render using PHP’s htmlentities(), htmlspecialchars_decode(), and html_entity_decode().

Each sanitizing instruction simply renders it’s.

Is there a PHP function I should use to translate? Does it even matter? That is, can I have html codes in a meta tag that is essential for SEO?

Hope this is clear…thanks for any feedback.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T17:43:49+00:00Added an answer on May 31, 2026 at 5:43 pm

    This is the one I’ve put together for exactly he same reason. You could remove the strip_tag() line if you are happy to keep HTML in their posts.

    function convert_to_plaintext($message)
      {
        $message = strip_tags($message);
    
        //Quotes: Replace smart double quotes with straight double quotes.
        //ANSI version for use with 8-bit regex engines and the Windows code page 1252.
        preg_replace('[\x84\x93\x94]', '"', $message);
    
        //Quotes: Replace smart single quotes and apostrophes with straight single quotes.
        //ANSI version for use with 8-bit regex engines and the Windows code page 1252.
        preg_replace("[\x82\x91\x92]", "'", $message);
    
        //Quotes: Replace straight apostrophes with smart apostrophes
        preg_replace("/(\b'\b)/", "?", $message);
    
        //Quotes: Replace straight double quotes with smart double quotes.
        //ANSI version for use with 8-bit regex engines and the Windows code page 1252.
        preg_replace('/(\B"\b([^"\x84\x93\x94\r\n]+)\b"\B)/', '?\1?', $message);
    
        //Quotes: Replace straight double quotes with smart double quotes.
        //Unicode version for use with Unicode regex engines.
        //preg_replace('/(\B"\b([^"\u201C\u201D\u201E\u201F\u2033\u2036\r\n]+)\b"\B)/', '?\1?', $message);
        $message = str_replace(array('%u201C','%u201D','%u201E','%u201F','%u2033','%u2036'),'"',$message);
    
        //Quotes: Replace straight single quotes with smart single quotes.
        //Unicode version for use with Unicode regex engines.
        //preg_replace("/(\B'\b([^'\u2018\u2019\u201A\u201B\u2032\u2035\r\n]+)\b'\B)/", "?\1?", $message);
        $message = str_replace(array('%u2018','%u2019','%u201A','%u201B','%u2032','%u2035'),"'",$message);
    
        //Quotes: Replace straight single quotes with smart single quotes.
        //ANSI version for use with 8-bit regex engines and the Windows code page 1252.
        preg_replace("/(\B'\b([^'\x82\x91\x92\r\n]+)\b'\B)/", "?\1?", $message);
    
        $message = str_replace("\n\n\n","\n\n",$message);
        $message = str_replace("\n\n\n","\n\n",$message);
        $message = str_replace("\n\n\n","\n\n",$message);
        $message = str_replace("\n\n\n","\n\n",$message);
        $message = str_replace("\n\n\n","\n\n",$message);
        $message = str_replace("\n",'<br/>',$message);
    
        return $message;
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a hosted site that has a CMS we built running on a
So I have a centralised CMS with multiple sites running from a single DB.
I have a gem that requires a 'Cms' namespace to be present when running.
So i have a custom CMS running under .Net 3.5 written entirely in c#.
I have to upgrade a running wordpress site's wordpress CMS and some installed plugins.and
I have a CMS that uses a syntax based on HTML comments to let
At my current job we have a CMS system that is .NET/SQL Server based.
This is a bit of a specific request unfortunately. I have a CMS that
We have a custom PHP/MySQL CMS running on Linux/Apache thats rolled out to multiple
I have a simple CMS running PHP/MySQL and I'm looking for the most efficient

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.