Encode or Redirect the Listing Website URL

This topic contains 1 reply, has 2 voices, and was last updated by  Kiran 6 years, 3 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #413331

    Jacob Paulsen
    Full Member
    Post count: 45

    Sorry if this is already covered elsewhere in the forum… I couldn’t find it.

    I’ve used other directory solutions in the past that allowed the admin to choose to use an encoded URL for the listing’s website and to have that encoding turned off for paid listings.

    In other words for a free listing I may want the business owner to be able to include the website field but would rather that website either have a no-follow attribute or be encoded such that they do not get the SEO benefit from the URL being on the directory site.

    With paid listings however the encoding or no-follow attribute is removed and the business owner does get the SEO benefits.

    Can this be achieved?

    #413405

    Kiran
    Moderator
    Post count: 7069

    Hi Jacob,

    You following code snippet to remove nofollow attribute for particualr package.

    
    
    // Remove nofollow for particular package id
    function _gd_custom_remove_rel_nofollow( $html, $location, $cf, $p = 0 ) {
    	global $post;
    
    	if ( ! empty( $html ) && ! empty( $post->package_id ) ) {
    		if ( (int)$post->package_id == 5 ) { // REPLACE 5 WITH YOUR PACKAGE ID
    			$html = str_replace( 'rel="nofollow"', '', $html );
    		}
    	}
    
    	return $html;
    }
    add_filter( 'geodir_custom_field_output_url', '_gd_custom_remove_rel_nofollow', 100, 4 );

    Thanks,
    Kiran

Viewing 2 posts - 1 through 2 (of 2 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket