Marketpress Coupon Codes Exposed in Blog Search

Well, here's an awkward "undocumented feature" I'm hoping the Marketpress developers can add to the To Do list...

Searching for keywords on a site with Marketpress installed will reveal any coupon codes that include those words.

Is there any way to disable indexing of custom "mp_coupon" post types so they are not found via the native WordPress blog search?

NOTE: I've confirmed that the Global Site Search plugin does not find these coupon codes, since we can select to index only default "post" types.

Searching the specific blog, however - in our case - reveals any coupon code including the search term(s). Clicking the actual post link reveals no data, but the URL does include /?post_type=mp_coupon&p=x

Anyone savvy enough to recognize the results as a coupon code could apply them!

Please advise if there is anything I can do to address this issue . Otherwise, please consider this a feature request to disable indexing of coupons in Marketpress, and presumably Pro Sites, Membership or any other plugins that offer coupon codes.

I do understand this may be tricky, since not indexing all MP custom post types would eliminate products from search results too. That's why I'm leaving up to you experts.

Thanks in advance for any feedback! Any questions?

  • Adam Czajczyk
    • Support Gorilla

    Hello @jcnjr,

    I hope you're well today and thank you for your question!

    I've checked this using my test install and can confirm the issue. Thanks for pointing this out. I think that although there's a relatively small chance that somebody will make use of that, it is indeed a "glitch" that may result in profit decrease for site owners!

    That said, it would be good to prevent search engine crawlers from indexing "coupon" pages. This could be achieved with "robots.txt" file but if you're using a SEO plugin it should also be doable to either set "no index" parameter for this. Alternatively, one could use any 301 redirect plugin to create 301-type (permanent) redirects for that "coupon pages".

    This should stop Google and other search engines from indexing coupons. Still, they'd be visible in search results. Therefore it would be necessary to exclude "mp_coupon" post type from WP search results (and possibly also Post Indexer). I'm forwarding this to the plugin developer immediately and hopefully he'll be able to provide a fix soon.

    Thanks again for pointing this out and have a nice day!

  • jcnjr
    • HummingBird

    @Adam Czajczyk Thanks for the quick reply!

    I agree it might be a rare case that someone actually uses the revealed coupon codes, and we haven't experienced that yet.

    I just thought I'd point out the issue, and will gladly wait for any feedback from the developers or plugin update to address the issue.

  • Adam Czajczyk
    • Support Gorilla

    Hello @jcnjr,

    I absolutely agree with you that even such rare cases shouldn't be ignored. This has already been passed to plugin developer so I hope he'll be able to fix that soon, though I'm not able to give you any ETA on this.

    In case I heard anything from him soon on this, I'll let you know here of course.

    Have a nice day!

  • Vaughan
    • Support/SLS MockingJay

    hi @jcnjr,

    Just chipping in, i've already noted this in the ticket thatadam created:slight_smile:

    Find following function in /includes/addons/mp-coupons/class-mp-coupons-addon.php

    	 * Register post type
    	 * @since 3.0
    	 * @access public
    	public function register_post_type() {
    		register_post_type( 'mp_coupon', array(
    			'labels'             => array(
    				'name'               => __( 'Coupons', 'mp' ),
    				'singular_name'      => __( 'Coupon', 'mp' ),
    				'menu_name'          => __( 'Manage Coupons', 'mp' ),
    				'all_items'          => __( 'Coupons', 'mp' ),
    				'add_new'            => __( 'Create New', 'mp' ),
    				'add_new_item'       => __( 'Create New Coupon', 'mp' ),
    				'edit_item'          => __( 'Edit Coupon', 'mp' ),
    				'edit'               => __( 'Edit', 'mp' ),
    				'new_item'           => __( 'New Coupon', 'mp' ),
    				'view_item'          => __( 'View Coupon', 'mp' ),
    				'search_items'       => __( 'Search Coupons', 'mp' ),
    				'not_found'          => __( 'No Coupons Found', 'mp' ),
    				'not_found_in_trash' => __( 'No Coupons found in Trash', 'mp' ),
    				'view'               => __( 'View Coupon', 'mp' )
    			'capability_type'    => array( 'mp_coupon', 'mp_coupons' ),
    			'capabilities'       => array(
    				'publish_posts'       => 'publish_mp_coupons',
    				'edit_posts'          => 'edit_mp_coupons',
    				'edit_others_posts'   => 'edit_others_mp_coupons',
    				'delete_posts'        => 'delete_mp_coupons',
    				'delete_others_posts' => 'delete_others_mp_coupons',
    				'read_private_posts'  => 'read_private_mp_coupons',
    				'edit_post'           => 'edit_mp_coupon',
    				'delete_post'         => 'delete_mp_coupon',
    				'read_post'           => 'read_mp_coupon',
    			'map_meta_cap'       => true,
    			'public'             => true,
    			'show_ui'            => true,
    			'show_in_menu'       => false,
    			'hierarchical'       => false,
    			'rewrite'            => false,
    			'query_var'          => false,
    			'supports'           => array( '' ),
    			'publicly_queryable' => true,
                'exclude_from_search' => true
    		) );

    Add exclude_from_search => true to the end as in above. (last line)

    That should actually prevent it all being well.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.