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

  • SEARCH
  • Home
  • 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 6071639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:04:14+00:00 2026-05-23T10:04:14+00:00

I have a blog on WordPress that I have control over in order to

  • 0

I have a blog on WordPress that I have control over in order to edit and format the RSS feed content. I have another website on which I want to display the excerpts of the posts from my blog, then link to the blog directly for the full post. The feed I am getting is fine except I have some unwanted untagged text displaying, and because it has no HTML tags I can’t use CSS to hide it. (I appreciate that I also need to debug the feed and probably the blog content, as the feed code I’m using doesn’t give this error on any other blogs I’ve set up, but that’s a separate issue).

This is the format of the HTML that is being generated from the feed:

        <li class="rss-item">
      <a class="rss-item" href="http://myblog.com/post-title">Post Title</a>
      <br>
      http://myblog.com/post-title/Post Title <!-- this line I want to remove -->
      <div class="thumbnail">
        <a href="#">
        <img src="thumbnail.jpg">
        </a>
      </div>
      <div class="excerpt">Excerpt text</div>
      <a href="http://myblog.com/post-title">Continue reading...</a>
    </li>

I wish to extract the text node for the untagged text (which displays the URL and Post Title on the page) and either remove it using JQuery, or add some span tags and hide it using CSS. My JQuery knowledge is very limited, and I have tried to edit various bits of code I’ve found online without success. Can anyone help?

  • 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-23T10:04:14+00:00Added an answer on May 23, 2026 at 10:04 am
    var tn = $('a.rss-item[href="http://myblog.com/post-title"] + br')[0].nextSibling;
    
    tn.parentNode.removeChild( tn );
    

    Example: http://jsfiddle.net/BZ5Tx/

    This finds the br element whose previous sibling is the a element with the rss-item class and the href http://myblog.com/post-title.

    Then it extracts the DOM element, gets the nextSibling which should be the text node, and stores it in a variable.

    Then from the text node, get the parentNode and use removeChild to remove the text node.


    If this is a repeating pattern with different urls, you can try this selector instead:

    $('a.rss-item[href] + br');
    

    …and use a loop:

    $('a.rss-item[href] + br').each(function() {
    
        var tn = this.nextSibling;
    
        tn.parentNode.removeChild( tn );
    
    });
    

    As noted by @Anurag, it’s a good idea to do a loop at each location, removing text nodes until a non text node is reached, just in case there are adjacent text nodes.

    $('a.rss-item[href] + br').each(function() {
    
        var tn = this;
    
        while( tn = tn.nextSibling  ) {
            if( tn.nodeType === 3 ) {
                tn.parentNode.removeChild( tn );
            }
        }
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have setup a wordpress multisite blog that is load balanced over 5 servers
I have a self-hosted WordPress blog post that got popular and has over 100
I have a WordPress blog that's hosted within my site (http://www.mysite.com/blog) and my website
I'm starting a Wordpress Blog that will have adult content on it, so I'll
I have a WordPress blog and I'm trying to make that when a user
i have wordpress blog in my custom built website, i am displaying some posts
I have got a blog in wordpress (www.ashwinm.com) which i am looking to migrate
I have this wordpress blog that has many pages with subpages that dropdown on
I want my WordPress blog to have a page called music. On that page
I have a Wordpress blog on my domain that was set up by a

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.