Understanding how individuals change their opinions is essential to mitigating the harmful effect of fake news and stopping opinion polarization. The current situation in the field of opinion dynamics models is that we still do not know exactly how social influence changes individuals' opinions and behavior. The question of which model best describes real social processes remains debatable. The current paper attempts to reconcile this problem. Building upon a relatively simple opinion dynamics model that can capture the key microscopic mechanisms of social influence and affords a tractable description of various complex influence hierarchies of social systems whereby agents may differ in how they are open to influence and how influential they are, we elaborate a framework to find optimal control, which, thus, can be applied to a broad set of opinion dynamics settings. Using a combination of theoretical and computational approaches, we characterize the properties of the optimal control and systematically demonstrate how these algorithms capture stylized examples, in which the key microscopic mechanisms of social influence as well as various influence hierarchies are covered.