The English expression “barking up the wrong tree” is commonly used in informal contexts. It does not relate to nature or animals and is in fact used as a metaphor.
The expression is used to suggest that one has been looking for something in completely the wrong place or heading in completely the wrong direction; both literally and physically. It can also be used in relation to making an accusation and having accused the wrong person.
The expression can be dated back to America during the 1800s when hunting with packs of dogs was extremely popular. At this time the expression was used when prey would trick dogs into believing they were hiding in a certain tree when in fact they had already managed to escape and move to another tree. At this time it was used purely in a literal sense to denote dogs which were literally barking at and trying to hunt an animal in the wrong tree. It was first used in a more metaphorical sense in 1832 in James Kirke Paulding’s Westward Ho! which writes “so I thought I’d set him barking up the wrong tree a little.” After this first recorded usage the expression began appearing frequently in publications, particularly in newspaper articles.
An example of the usage of this expression can be found in James Hall’s 1833 Legends of the West, where he wrote, “It doesn’t take a Philadelphia lawyer to tell that the man who serves the master one day, and the enemy six, has just six chances out of seven to go to the devil. You are barking up the wrong tree, Johnson.”