For inference in complex models, composite likelihood combines genuine likelihoods based on low‐dimensional portions of the data, with weights to be chosen. Optimal weights in composite likelihood may be searched following different routes, leading to a solution only in scalar parameter models. Here, after briefly reviewing the main approaches, we show how to obtain the first‐order optimal weights when using composite likelihood for inference on a scalar parameter in the presence of nuisance parameters. These weights depend on the true parameter value and need to be estimated. Under regularity conditions, the resulting likelihood ratio statistic has the standard asymptotic null distribution and improved local power. Simulation results in multivariate normal models show that estimation of optimal weights maintains the standard approximate null distribution and produces a visible gain in power with respect to constant weights.