WASHINGTON — [Read more: Bernie Sanders drops out of 2020 democratic presidential race.]

When Senator Bernie Sanders brought his presidential campaign to Pittsburgh earlier this year, he quietly added a poignant stop to his schedule: a visit to the Tree of Life synagogue, where 11 congregants were killed in an anti-Semitic shooting last fall.

But his appearance also came with explicit instructions to his campaign aides, according to two Democrats familiar with the conversation: They were not to tell the news media about his conversation with the rabbi there.

Some aides dissented, believing there was a graceful way to disclose the visit. But Mr. Sanders, the only Jewish candidate among the leading Democratic contenders, did not want the visit to be perceived as a publicity grab. His impulse illustrated a deeper challenge confronting his aides and supporters: After nearly four decades of running, and usually winning, iconoclastic campaigns on his own terms, he is deeply reluctant to change his approach.

Mr. Sanders has been unwilling to regularly talk about his personal history of growing up poor in a Brooklyn neighborhood full of Holocaust survivors, and until recently he resisted letting his campaign poll voters in Iowa, the first nominating state. He has largely defied his staff’s urging that he go on the offensive against Joseph R. Biden Jr., the Democratic front-runner.