This paper introduces an application of the dandelion optimization (DO) algorithm in antenna arrays. This is the first time that the DO algorithm has been used for optimizing antenna arrays. For antenna array optimization, sidelobe level (SLL) and deep nulls are key technical indicators. A lower SLL can improve the signal-to-noise ratio and reduce the impact of clutter signals outside the main beam. Deep nulls need to be aligned with the direction of interference to eliminate the influence of interference sources. The combination of the two can effectively improve the anti-interference ability of the entire system. Therefore, antenna arrays with ultra-low sidelobes and ultra-deep nulls are currently hot in the field of antenna array design and are also some of the key technologies needed to achieve modern high-performance radar systems. As a new type of evolutionary algorithm inspired by nature, the DO algorithm is inspired by the wind propagation behavior of dandelions in nature. This algorithm iteratively updates the population from three stages of ascent, descent, and landing, ultimately finding the optimal position. It has good optimization ability in solving complex problems such as those involving nonlinearity, discreteness, and non-convexity, and the antenna array pattern synthesis optimization problem belongs to multivariate nonlinear problems. Therefore, the DO algorithm can be effectively applied in the field of antenna array optimization. In this work, we use the following method to obtain an optimized pattern of a linear array with the lowest sidelobe level (SLL), null placement in particular directions, and a lower notch in particular directions: by controlling the antenna array’s element spacing and leaving the phase unchanged to optimize the current amplitudes and by controlling the excitation current and phase fixation of the antenna array and changing the element spacing. In the first and second examples, different algorithms are used to reduce the SLL of the antenna. In the first example, the DO algorithm reduces the SLL to −33.37 dB, which is 2.67 dB, 2.67 dB, 3.77 dB, 2.74 dB, and 2.52 dB lower than five other algorithms. In the second example, the SLL optimized by the DO algorithm is −42.56 dB, which is 5.04 dB and 1.48 dB lower than two other algorithms. In both examples, the DO algorithm reduces the SLL lower than other algorithms when the main lobe of the antenna is not significantly widened. Examples 3, 4, and 5 use the DO algorithm to optimize the amplitude of the current, generating deep nulls and deep notches in specific directions. In Example 3, the DO algorithm obtains a depth of nulls equal to −187.6 dB, which is 66.7 dB and 44.3 dB lower than that of the flower pollination algorithm (FPA) and the chaotic colony predation algorithm (CCPA), respectively. In Example 4, the deep null obtained by the DO algorithm is as low as −98.69 dB, which is 6.67 dB lower than the deep null obtained by the grey wolf optimization (GWO) algorithm. In Example 5, the deep notch obtained by the DO algorithm is as low as −63.1 dB, which is 6.4 dB and 1.9 dB lower than the spider monkey optimization (SMO) algorithm and the grasshopper optimization algorithm (GOA), respectively. The data prove that the DO algorithm produces deeper nulls and notches than other algorithms. The last two examples involve reducing sidelobe levels and generating deep nulls by optimizing the spacing between elements. In Example 5, the SLL obtained using the DO algorithm is −22.8766 dB, which is 0.1998 dB lower than the lowest SLL of −22.6768 dB among other algorithms. In Example 6, the SLL obtained using the DO algorithm is −20.1012 dB, and the null depth is −125.1 dB, which is 1.592 dB lower than the SLL obtained by the cat swarm optimization (CSO) algorithm and 19.1 dB lower than the deep null obtained by the GWO algorithm, respectively. In summary, the results of six simulation experiments indicate that the DO algorithm has better optimization ability in linear array optimization than other evolutionary algorithms.