I want to stop wordpress to create new page for every post that I make. Like whenever I am making an post "xyz title", my coupon theme creates an seperate page for it like "http://mydomain.com/code/xyz-title" which is then getting crawled by google. But I already applied post redirection.. like whenever someone clicks on latest post its directly gets redirected to external URL. Please can anyone help?
You cannot stop WP from creating posts unless you write your own plugin. You can use robots.txt to prevent spiders from indexing these pages, though.
Great answer Devtard - I would suggest not using 301s and just recreating the content on a new page. Why create 301s?
I would say, what you're doing in a 'long-way home' kind of thing. What you need is a better structure your site. You can use Custom Post Types and Custom Fields feature from WordPress. Once this is done - you have a nice post formats to create multiple entries which can be displayed on home or any category page.... & then use custom fields within these new entries to add external URLs to go to when clicked on . . say "Claim This Offer". Install Yoast SEO plugin to then noindex these post_types. Little lengthy procedure for once but peace of mind of later... Hope this helps