Replace tags with space in PHP for SEO Meta Description

0 votes

I am trying to strip tags from HTML in a MySQL database to plain text for an SEO Meta Description. The HTML in the database looks like this:

<p>The Break-ezee is a vital piece of equipment for anyone when breaking horses - As used by Mary King.</p>
<p></p>
<p>The Break-ezee is an all in one progressive training product for use when breaking horses.</p>

I am using the following PHP to format it:

$showseodesc = trim(strip_tags(substr($showseoproduct['text'],0,160)));

This shows the following in the source of the site:

<meta name="description" content="The Break-ezee is a vital piece of equipment for anyone when breaking horses - As used by Mary King.

The Break-ezee is an all in one progressi" />

Is there any way I can replace any tags (in this case <p>) so there are no spaces?

I am ideally looking for the Meta Description to look like this:

<meta name="description" content="The Break-ezee is a vital piece of equipment for anyone when breaking horses - As used by Mary King. The Break-ezee is an all in one progressi" />

Also, am I correct in thinking Google doesn't pick up extra spaces for the Meta Description?

Mar 12, 2022 in Digital Marketing by Kichu
• 19,040 points
604 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Digital Marketing

0 votes
0 answers

SEO and Django with title and description tags

I have a base.html for the base ...READ MORE

Mar 8, 2022 in Digital Marketing by Kichu
• 19,040 points
569 views
0 votes
1 answer

How to over-ride meta data in Wordpress, using Squirrly SEO

if (is_archive()){ add_filter('sq_title', 'filter_product_wpseo_metadesc'); function filter_product_wpseo_metadesc($wpseo_metadesc){ ...READ MORE

answered Mar 1, 2022 in Digital Marketing by narikkadan
• 63,600 points
863 views
0 votes
0 answers

meta tags that are vital for a website

Mar 3, 2022 in Digital Marketing by Kichu
• 19,040 points
357 views
0 votes
0 answers

modify description on Wp All in one seo

live website, it doesn't shows full description ...READ MORE

Mar 3, 2022 in Digital Marketing by Kichu
• 19,040 points
338 views
0 votes
0 answers

Adding microdata or schema.org for breadcrumb SEO in Drupal 7

I'm currently a little confused about microdata ...READ MORE

Mar 4, 2022 in Digital Marketing by Kichu
• 19,040 points
806 views
0 votes
0 answers

How to over-ride meta data in Wordpress, using Squirrly SEO

I currently have a Wordpress website using ...READ MORE

Mar 4, 2022 in Digital Marketing by Kichu
• 19,040 points
584 views
0 votes
0 answers

Replace tags with space in PHP for SEO Meta Description

I am trying to strip tags from ...READ MORE

Mar 13, 2022 in Digital Marketing by Kichu
• 19,040 points
658 views
0 votes
1 answer

opencart seo url rewriting

first of all to do this you ...READ MORE

answered Feb 20, 2022 in Others by narikkadan
• 63,600 points
895 views
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

answered Aug 8, 2020 in PHP by anonymous
10,567 views
0 votes
1 answer

Why is not preferable to use mysql_* functions in PHP?

The reasons are as follows: The MySQL extension: Does ...READ MORE

answered Sep 7, 2018 in Database by DataKing99
• 8,250 points
1,276 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP