||By exploiting the coupling between convection and thermodiffusion, we examine in this study the possibility to perform separation of species in viscoelastic solutions saturating a porous cavity heated from below. We analyze the thermal convection thresholds and linear characteristics of the primary and secondary instabilities for binary mixtures with viscoelastic properties taking into account the Soret effect and the lateral confinement of the medium. We focus on viscoelastic mixtures with positive separation ratio ψ, a dimensionless parameter which represents the mass contribution divided by the temperature contribution to buoyancy forces and is proportional to the strength of the Soret effect. In that case, the lighter component of the viscoelastic solution is driven into the direction of the bottom of the cavity, thus further enhancing the density gradient. We find that for sufficiently elastic mixtures, oscillatory instability may be sustained for small positive ψ contrary to the case of Newtonian mixtures, where oscillatory convection occurs only for ψ<0. For ψ>ψmono>0 a stationary bifurcation leads to a monocellular flow at the onset of convection, with a horizontal stratification of the concentration, allowing separation of species between the two ends of the cell. The optimum of separation is obtained for a particular value Raopt of the Rayleigh number. The linear stability analysis of the monocellular flow is performed, and the critical conditions above which the flow becomes unstable are determined. The combined influence of the viscoelastic parameters and the lateral confinement on the characteristics of the secondary instability is quantified as a function of ψ. It is found that, depending on the lateral confinement, the monocellular flow may lose its stability via a Hopf bifurcation giving rise to transversal travelling rolls or via a stationary bifurcation to fixed longitudinal rolls. When the secondary bifurcation is a Hopf one, two regimes of convection are identified. While the viscoelastic mechanism plays a key role in one regime, the other regime is dominated by the Soret effect. Independently of the nature of the secondary instability pattern, it is shown that the monocellular flow remains stable beyond Raopt indicating that optimal separation of species is possible for viscoelastic solutions.