Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

So i got the RSS feed which output some custom post types, but the GUID looks bad to me, it's like:

?post_type=mycustompost&p=124

The reason i want to change this is that I don't need people to know it's Wordpress or to see my custom post type name (this is very important in this project)

Is there a filter or hook to rewrite this?

Thanks

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

The feed template files call the_guid(), which calls get_the_guid(), which has a filter named (surprisingly) get_the_guid. You can hook into this filter to change the output. The filter only gets the current GUID, not the post ID, so look this up in the global variable if you need it.

add_filter( 'get_the_guid', 'wpse17463_get_the_guid' );
function wpse17463_get_the_guid( $guid )
{
    return 'http://example.com/guid/' . sha1( $guid );
}

See also this Trac ticket which proposes to change the current GUID format to a more unique hash.

share|improve this answer
    
thanks, that's what i needed exactly ) –  Alex May 17 '11 at 14:42
add comment

I didn't get where you see that GUID. But if it's the title link, you can try:

function my_permalink($permalink) {
    global $wp_query;
    $permalink = get_permalink( $wp_query->post->ID );
    return $permalink;
}

add_filter('the_permalink_rss', 'my_permalink');
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.