Apple (AAPL -0.35%), one of the "Magnificent Seven" stocks prized for growth and earnings stability, helped propel the overall stock market back toward all-time highs in 2023.

Apple's performance was rock solid despite higher interest rates and a resulting weakening of global consumer spending. When accounting for reinvested dividends, Apple stock's total return was an incredible 45% in 2023.

Though I favor making small, gradual portfolio changes over time, I decided to sell some Apple stock near the end of 2023. Here's why and where I invested instead.

The most "expensive" magnificent seven stock?

Through thick and thin, I've owned Apple for many years. 2023 was an interesting year. Despite being part of the vaunted group of Magnificent Seven tech giants (thanks to the aforementioned stock price outperformance), it was actually far from a perfect year for Apple.

The iPhone remains far and away the flagship product, accounting for 52% of the company's $383 billion in revenue in fiscal 2023 (which ended in September). But as I wrote in November, even iPhone sales fell slightly. Paired with a steep drop in the PC (primarily the MacBook for Apple) and other consumer electronics markets (e.g., iPad, Watch, AirPods, Beats), not even the ongoing growth in Services was enough to keep Apple revenue on the rise.

Apple was able to offset this weakness with ample share repurchases. It repurchased and retired $77.6 billion worth of stock, effectively reducing its share count by 3% last year and boosting earnings per share for shareholders.

That was a great strategy for investors during the bear market over the last couple of years, and my over-allocation to Apple helped keep my portfolio afloat. However, slow growth and stock buybacks may not be the best strategies if you believe (as I do) a new bull market might be in the early innings.

Apple stock looks expensive, given the sluggish earnings growth expected for 2024. In fact, of all the Magnificent Seven stocks, Apple has the lowest long-term earnings growth rate (9% expected), yet trades for a premium 28 times Wall Street analysts' expectations for next year's earnings.

AAPL PE Ratio (Forward) Chart

Data by YCharts. PE Ratio = price-to-earnings ratio. EPS = earnings per share. LT = long term.

This is why I sold some Apple to redeploy the proceeds elsewhere. That said, I still have plenty of Apple stock. That now comes primarily via my old index fund investments in Vanguard Growth ETF (of which Apple is about 13% of the portfolio), Vanguard Information Technology ETF (22% of the portfolio), and Warren Buffett's Berkshire Hathaway (nearly 50% of Berkshire's publicly traded stock holdings).

Nevertheless, with Apple maturing into a slower-growth business, and given that I have decades left before I need my investment dollars, I felt it necessary to trim and rebalance.

Where I'm investing my Apple winnings

When looking for a replacement for my portfolio rebalance, I started with the Magnificent Seven themselves. I already purchased additional Alphabet last year. However, the other two parts of the big digital advertising market -- Meta Platforms (NASDAQ: META) and Amazon (AMZN 3.43%) -- still look attractively priced for an expected rally in earnings in 2024. I've been building up a larger position in Amazon as it figures out how better to monetize its massive e-commerce and digital consumer empire.

GOOGL PE Ratio (Forward) Chart

Data by YCharts. PE Ratio = price-to-earnings ratio. EPS = earnings per share. LT = long term.

After an epic year for the buildout of generative AI infrastructure (mostly to Nvidia's gain), I think beaten-up software stocks could benefit in 2024 as all that newly installed AI hardware starts to get monetized. I added to a longtime position in Salesforce (CRM 0.42%) again and am looking to finally start buying ServiceNow (NOW 1.02%) sometime this year. Other cloud computing stocks look compelling for the new year as well.

And, of course, I still like semiconductor stocks, too, especially if the iPhone and other consumer electronic sales notch a rebound in 2024.

To be clear, Apple looks like it has all the ingredients to continue as a great long-term investment. Growth may be more moderate than in times past, but the tech titan is highly profitable and doles out ample cash to shareholders. I'm happy to continue holding, but a high valuation compared to some other tech stocks makes me think there are better growth opportunities available right now.