In SharePoint 2013 when you create a new page under a publishing page it adds a new Term under the "site navigation" termset of the site collection. What I want to do, is having more control on where this term is created. I want to prevent it to be created directly under the "Site Navigation" termset, but under the site's term. I was wandering to create a feature to do it for me but I have two problems, 1. I dont know where I need to assign the navigation type and the friendly url. 2. How do I prevent SharePoint to do it for me.
There are some options available for you under Site settings -> Navigation. For example, in the "Managed Navigation: Term Set" section, you can specify term set different from 'Site Navigation', and from now on your new pages will get terms in that term set. You can also uncheck "Create friendly URLs for new pages automatically" and "Add new pages to navigation automatically", and if you do that, no new terms will be created for new pages added by you in the Term Store.
Also, after a term is created, you can always move it to the required location using either Term Store manager or an object model. If you have too many terms, you can always write a piece of code (e.g. powershell script) to bulk move all the terms. This page has some information to help you get started http://msdn.microsoft.com/en-us/library/jj163949.aspx
In order to add new terms to navigation term set, you can use the following code: